From e91c4c5260407e40f24a0662a16d9a3a8118ab37 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 11 Aug 2020 00:04:28 -0300 Subject: [PATCH] Streams: return buffers from ReadStream#readBuffer, not strings --- lib/streams.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/streams.ts b/lib/streams.ts index 8aa6df2803..19a68d294e 100644 --- a/lib/streams.ts +++ b/lib/streams.ts @@ -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;