Lines Matching refs:buffer
7 const SlowBuffer = require('buffer').SlowBuffer;
119 // Try to copy 0 bytes worth of data into an empty buffer
122 // Try to copy 0 bytes past the end of the target buffer
126 // Try to copy 0 bytes from past the end of the source buffer
144 // Offset points to the end of the buffer and does not throw.
229 const buffer = Buffer.allocUnsafe(32);
230 const size = buffer.write(testValue, 0, 'utf8');
231 const slice = buffer.toString('utf8', 0, size);
671 const buffer = Buffer.allocUnsafe(data.length);
672 data.forEach((v, k) => buffer[k] = v);
673 return buffer;
860 // Test for buffer overrun
901 // Regression test, guard against buffer overrun in the base64 decoder.
1037 () => Buffer.from('', 'buffer'),
1041 message: 'Unknown encoding: buffer'
1046 // Constructing a buffer from another buffer should a) work, and b) not corrupt
1047 // the source buffer.
1127 message: '"offset" is outside of buffer bounds'
1139 // Unpooled buffer (replaces SlowBuffer)
1143 assert(ubuf.buffer);
1144 assert.strictEqual(ubuf.buffer.byteLength, 10);
1153 Buffer.from({ buffer: arrayBuf });