Streams: return buffers from ReadStream#readBuffer, not strings

This commit is contained in:
Ben Davies 2020-08-11 00:04:28 -03:00
parent 5cee3b401f
commit e91c4c5260

View File

@ -260,7 +260,7 @@ export class ReadStream {
async readBuffer(byteCount: number | null = null) {
await this.loadIntoBuffer(byteCount, true);
const out = this.peek(byteCount) as Buffer | null;
const out = this.peekBuffer(byteCount);
if (byteCount === null || byteCount >= this.bufSize) {
this.bufStart = 0;
this.bufEnd = 0;