diff --git a/lib/buffer-util.js b/lib/buffer-util.js index 4a6e8e7cd..f7536e28e 100644 --- a/lib/buffer-util.js +++ b/lib/buffer-util.js @@ -92,9 +92,9 @@ function toBuffer(data) { let buf; if (data instanceof ArrayBuffer) { - buf = Buffer.from(data); + buf = new FastBuffer(data); } else if (ArrayBuffer.isView(data)) { - buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength); } else { buf = Buffer.from(data); toBuffer.readOnly = false;