diff --git a/src/readBuffer.js b/src/readBuffer.js index d6936e9..44475d6 100644 --- a/src/readBuffer.js +++ b/src/readBuffer.js @@ -1,4 +1,8 @@ export default function readBuffer(pipe, length, callback) { + if (length === 0) { + callback(null, new Buffer(0)); + return; + } let remainingLength = length; const buffers = []; const readChunk = () => {