diff --git a/src/reader.js b/src/reader.js index 9e501cdcc..fdc0a1f7e 100644 --- a/src/reader.js +++ b/src/reader.js @@ -51,7 +51,9 @@ Reader.create = util.Buffer if (!BufferReader) BufferReader = require("./reader_buffer"); return (Reader.create = function create_buffer(buffer) { - return new BufferReader(buffer); + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + : new Reader(buffer); })(buffer); } /* istanbul ignore next */