Node.js v0.12.18 Manual & Documentation
Table of Contents
- Buffer
- Class: Buffer
- new Buffer(size)
- new Buffer(array)
- new Buffer(buffer)
- new Buffer(str[, encoding])
- Class Method: Buffer.isEncoding(encoding)
- Class Method: Buffer.isBuffer(obj)
- Class Method: Buffer.byteLength(string[, encoding])
- Class Method: Buffer.concat(list[, totalLength])
- Class Method: Buffer.compare(buf1, buf2)
- buf.length
- buf.write(string[, offset][, length][, encoding])
- buf.writeUIntLE(value, offset, byteLength[, noAssert])
- buf.writeUIntBE(value, offset, byteLength[, noAssert])
- buf.writeIntLE(value, offset, byteLength[, noAssert])
- buf.writeIntBE(value, offset, byteLength[, noAssert])
- buf.readUIntLE(offset, byteLength[, noAssert])
- buf.readUIntBE(offset, byteLength[, noAssert])
- buf.readIntLE(offset, byteLength[, noAssert])
- buf.readIntBE(offset, byteLength[, noAssert])
- buf.toString([encoding][, start][, end])
- buf.toJSON()
- buf[index]
- buf.equals(otherBuffer)
- buf.compare(otherBuffer)
- buf.copy(targetBuffer[, targetStart][, sourceStart][, sourceEnd])
- buf.slice([start][, end])
- buf.readUInt8(offset[, noAssert])
- buf.readUInt16LE(offset[, noAssert])
- buf.readUInt16BE(offset[, noAssert])
- buf.readUInt32LE(offset[, noAssert])
- buf.readUInt32BE(offset[, noAssert])
- buf.readInt8(offset[, noAssert])
- buf.readInt16LE(offset[, noAssert])
- buf.readInt16BE(offset[, noAssert])
- buf.readInt32LE(offset[, noAssert])
- buf.readInt32BE(offset[, noAssert])
- buf.readFloatLE(offset[, noAssert])
- buf.readFloatBE(offset[, noAssert])
- buf.readDoubleLE(offset[, noAssert])
- buf.readDoubleBE(offset[, noAssert])
- buf.writeUInt8(value, offset[, noAssert])
- buf.writeUInt16LE(value, offset[, noAssert])
- buf.writeUInt16BE(value, offset[, noAssert])
- buf.writeUInt32LE(value, offset[, noAssert])
- buf.writeUInt32BE(value, offset[, noAssert])
- buf.writeInt8(value, offset[, noAssert])
- buf.writeInt16LE(value, offset[, noAssert])
- buf.writeInt16BE(value, offset[, noAssert])
- buf.writeInt32LE(value, offset[, noAssert])
- buf.writeInt32BE(value, offset[, noAssert])
- buf.writeFloatLE(value, offset[, noAssert])
- buf.writeFloatBE(value, offset[, noAssert])
- buf.writeDoubleLE(value, offset[, noAssert])
- buf.writeDoubleBE(value, offset[, noAssert])
- buf.fill(value[, offset][, end])
- buffer.INSPECT_MAX_BYTES
- Class: SlowBuffer
- Class: Buffer
Buffer#
Stability: 3 - Stable
Pure JavaScript is Unicode friendly but not nice to binary data. When dealing with TCP streams or the file system, it's necessary to handle octet streams. Node has several strategies for manipulating, creating, and consuming octet streams.
Raw data is stored in instances of the Buffer class. A