133
134
constructor(source: model.ITextSnapshot) {
136
>
this._eos = false;
137
>
}
138
139
public read(): string | null {
141
return null;
142
}
144
>
const result: string[] = [];
145
>
let resultCnt = 0;
146
>
let resultLength = 0;
147
>
148
>
do {
149
>
const tmp = this._source.read();
150
>
151
>
if (tmp === null) {
152
>
// end-of-stream
153
>
this._eos = true;
154
>
if (resultCnt === 0) {
155
return null;
157
return result.join('');
158
}
160
>
161
>
if (tmp.length > 0) {
162
result[resultCnt++] = tmp;
163
resultLength += tmp.length;
164
}
166
>
if (resultLength >= 64 * 1024) {
167
return result.join('');
168
}
170
>
}
171
}
172