### new Buffer(array)
-* `array` Array
+* `array` {Array}
Allocates a new Buffer using an `array` of octets.
### new Buffer(size)
-* `size` Number
+* `size` {Number}
Allocates a new Buffer of `size` bytes. The `size` must be less than
or equal to the value of `require('buffer').kMaxLength` (on 64-bit
### new Buffer(str[, encoding])
-* `str` String - string to encode.
-* `encoding` String - encoding to use, Optional.
+* `str` {String} String to encode.
+* `encoding` {String} Default: `'utf8'`
Creates a new Buffer containing the given JavaScript string `str`. If
provided, the `encoding` parameter identifies the strings character encoding.
-If not provided, `encoding` defaults to `'utf8'`.
```js
const buf1 = new Buffer('this is a tést');
### Class Method: Buffer.byteLength(string[, encoding])
-* `string` String
-* `encoding` String, Optional, Default: 'utf8'
-* Return: Number
+* `string` {String}
+* `encoding` {String} Default: `'utf8'`
+* Return: {Number}
-Returns the actual byte length of a string. If not specified, `encoding`
-defaults to `'utf8'`. This is not the same as [`String.prototype.length`][]
-since that returns the number of *characters* in a string.
+Returns the actual byte length of a string. This is not the same as
+[`String.prototype.length`][] since that returns the number of *characters* in
+a string.
Example:
* `buf1` {Buffer}
* `buf2` {Buffer}
+* Return: {Number}
Compares `buf1` to `buf2` typically for the purpose of sorting arrays of
Buffers. This is equivalent is calling `buf1.compare(buf2)`.
* `list` {Array} List of Buffer objects to concat
* `totalLength` {Number} Total length of the Buffers in the list when concatenated
+* Return: {Buffer}
Returns a new Buffer which is the result of concatenating all the Buffers in
the `list` together.
### Class Method: Buffer.isBuffer(obj)
-* `obj` Object
-* Return: Boolean
+* `obj` {Object}
+* Return: {Boolean}
Returns 'true' if `obj` is a Buffer.
### Class Method: Buffer.isEncoding(encoding)
* `encoding` {String} The encoding string to test
+* Return: {Boolean}
Returns true if the `encoding` is a valid encoding argument, or false
otherwise.
-### buffer.entries()
-
-Creates and returns an [iterator][] of `[index, byte]` pairs from the Buffer
-contents.
-
-```js
-const buf = new Buffer('buffer');
-for (var pair of buf.entries()) {
- console.log(pair);
-}
-// prints:
-// [0, 98]
-// [1, 117]
-// [2, 102]
-// [3, 102]
-// [4, 101]
-// [5, 114]
-```
-
-### buffer.keys()
-
-Creates and returns an [iterator][] of Buffer keys (indices).
-
-```js
-const buf = new Buffer('buffer');
-for (var key of buf.keys()) {
- console.log(key);
-}
-// prints:
-// 0
-// 1
-// 2
-// 3
-// 4
-// 5
-```
-
-### buffer.values()
-
-Creates and returns an [iterator][] for Buffer values (bytes). This function is
-called automatically when the Buffer is used in a `for..of` statement.
-
-```js
-const buf = new Buffer('buffer');
-for (var value of buf.values()) {
- console.log(value);
-}
-// prints:
-// 98
-// 117
-// 102
-// 102
-// 101
-// 114
-
-for (var value of buf) {
- console.log(value);
-}
-// prints:
-// 98
-// 117
-// 102
-// 102
-// 101
-// 114
-```
-
### buf[index]
<!--type=property-->
### buf.compare(otherBuffer)
* `otherBuffer` {Buffer}
+* Return: {Number}
Compares two Buffer instances and returns a number indicating whether `buf`
comes before, after, or is the same as the `otherBuffer` in sort order.
### buf.copy(targetBuffer[, targetStart][, sourceStart][, sourceEnd])
-* `targetBuffer` Buffer object - Buffer to copy into
-* `targetStart` Number, Optional, Default: 0
-* `sourceStart` Number, Optional, Default: 0
-* `sourceEnd` Number, Optional, Default: `buffer.length`
+* `targetBuffer` {Buffer} Buffer to copy into
+* `targetStart` {Number} Default: 0
+* `sourceStart` {Number} Default: 0
+* `sourceEnd` {Number} Default: `buffer.length`
+* Return: {Number} The number of bytes copied.
Copies data from a region of this Buffer to a region in the target Buffer even
-if the target memory region overlaps with the source. If `undefined`, the
-`targetStart` and `sourceStart` parameters default to `0` while `sourceEnd`
-defaults to `buffer.length`.
-
-Returns the number of bytes copied.
+if the target memory region overlaps with the source.
Example: build two Buffers, then copy `buf1` from byte 16 through byte 19
into `buf2`, starting at the 8th byte in `buf2`.
// efghijghijklmnopqrstuvwxyz
```
+### buf.entries()
+
+* Return: {Iterator}
+
+Creates and returns an [iterator][] of `[index, byte]` pairs from the Buffer
+contents.
+
+```js
+const buf = new Buffer('buffer');
+for (var pair of buf.entries()) {
+ console.log(pair);
+}
+// prints:
+// [0, 98]
+// [1, 117]
+// [2, 102]
+// [3, 102]
+// [4, 101]
+// [5, 114]
+```
+
### buf.equals(otherBuffer)
* `otherBuffer` {Buffer}
+* Return: {Boolean}
Returns a boolean indicating whether `this` and `otherBuffer` have exactly the
same bytes.
### buf.fill(value[, offset][, end])
-* `value`
-* `offset` Number, Optional
-* `end` Number, Optional
+* `value` {String or Number}
+* `offset` {Number} Default: 0
+* `end` {Number} Default: `buffer.length`
+* Return: {Buffer}
-Fills the Buffer with the specified value. If the `offset` (defaults to `0`)
-and `end` (defaults to `buffer.length`) are not given it will fill the entire
-Buffer. The method returns a reference to the Buffer so calls can be chained.
+Fills the Buffer with the specified value. If the `offset` and `end` are not
+given it will fill the entire Buffer. The method returns a reference to the
+Buffer so calls can be chained.
```js
const b = new Buffer(50).fill('h');
### buf.indexOf(value[, byteOffset][, encoding])
-* `value` String, Buffer or Number
-* `byteOffset` Number, Optional, Default: 0
-* `encoding` String, Optional, Default: `utf8`
-* Return: Number
+* `value` {String, Buffer or Number}
+* `byteOffset` {Number} Default: 0
+* `encoding` {String} Default: `'utf8'`
+* Return: {Number}
Operates similar to [`Array#indexOf()`][] in that it returns either the
starting index position of `value` in Buffer or `-1` if the Buffer does not
### buf.includes(value[, byteOffset][, encoding])
-* `value` String, Buffer or Number
-* `byteOffset` Number, Optional, Default: 0
-* `encoding` String, Optional, Default: 'utf8'
+* `value` {String, Buffer or Number}
+* `byteOffset` {Number} Default: 0
+* `encoding` {String} Default: `'utf8'`
+* Return: {Boolean}
Operates similar to [Array#includes()][]. The `value` can be a String, Buffer
or Number. Strings are interpreted as UTF8 unless overridden with the
// returns false
```
+### buf.keys()
+
+* Return: {Iterator}
+
+Creates and returns an [iterator][] of Buffer keys (indices).
+
+```js
+const buf = new Buffer('buffer');
+for (var key of buf.keys()) {
+ console.log(key);
+}
+// prints:
+// 0
+// 1
+// 2
+// 3
+// 4
+// 5
+```
+
### buf.length
-* Number
+* {Number}
Returns the amount of memory allocated for the Buffer in number of bytes. Note
that this does not necessarily reflect the amount of usable data within the
### buf.readDoubleBE(offset[, noAssert])
### buf.readDoubleLE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 8`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads a 64-bit double from the Buffer at the specified `offset` with specified
endian format (`readDoubleBE()` returns big endian, `readDoubleLE()` returns
little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
```js
const buf = new Buffer([1,2,3,4,5,6,7,8]);
### buf.readFloatBE(offset[, noAssert])
### buf.readFloatLE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads a 32-bit float from the Buffer at the specified `offset` with specified
endian format (`readFloatBE()` returns big endian, `readFloatLE()` returns
little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
```js
const buf = new Buffer([1,2,3,4]);
### buf.readInt8(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 1`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads a signed 8-bit integer from the Buffer at the specified `offset`.
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
Integers read from the Buffer are interpreted as two's complement signed values.
### buf.readInt16BE(offset[, noAssert])
### buf.readInt16LE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 2`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads a signed 16-bit integer from the Buffer at the specified `offset` with
the specified endian format (`readInt16BE()` returns big endian,
`readInt16LE()` returns little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
Integers read from the Buffer are interpreted as two's complement signed values.
### buf.readInt32BE(offset[, noAssert])
### buf.readInt32LE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads a signed 32-bit integer from the Buffer at the specified `offset` with
the specified endian format (`readInt32BE()` returns big endian,
`readInt32LE()` returns little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
Integers read from the Buffer are interpreted as two's complement signed values.
### buf.readIntBE(offset, byteLength[, noAssert])
### buf.readIntLE(offset, byteLength[, noAssert])
-* `offset` {Number} `0 <= offset <= buf.length`
+* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
* Return: {Number}
```
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
### buf.readUInt8(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 1`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads an unsigned 8-bit integer from the Buffer at the specified `offset`.
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
```js
const buf = new Buffer([1,-2,3,4]);
### buf.readUInt16BE(offset[, noAssert])
### buf.readUInt16LE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 2`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads an unsigned 16-bit integer from the Buffer at the specified `offset` with
specified endian format (`readInt32BE()` returns big endian,
`readInt32LE()` returns little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
Example:
### buf.readUInt32BE(offset[, noAssert])
### buf.readUInt32LE(offset[, noAssert])
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
-* Return: Number
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number}
Reads an unsigned 32-bit integer from the Buffer at the specified `offset` with
specified endian format (`readInt32BE()` returns big endian,
`readInt32LE()` returns little endian).
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
Example:
### buf.readUIntBE(offset, byteLength[, noAssert])
### buf.readUIntLE(offset, byteLength[, noAssert])
-* `offset` {Number} `0 <= offset <= buf.length`
+* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
* Return: {Number}
```
Setting `noAssert` to `true` skips validation of the `offset`. This allows the
-`offset` to be beyond the end of the Buffer. When not specified, `noAssert`
-defaults to `false`.
+`offset` to be beyond the end of the Buffer.
### buf.slice([start[, end]])
-* `start` Number, Optional, Default: 0
-* `end` Number, Optional, Default: `buffer.length`
+* `start` {Number} Default: 0
+* `end` {Number} Default: `buffer.length`
+* Return: {Buffer}
-Returns a new Buffer that references the same memory as the original, but offset
-and cropped by the `start` (defaults to `0`) and `end` (defaults to
-`buffer.length`) indexes.
+Returns a new Buffer that references the same memory as the original, but
+offset and cropped by the `start` and `end` indices.
-**Note that modifying the new Buffer slice will modify the memory in the original Buffer because the allocated memory of the two objects overlap.**
+**Note that modifying the new Buffer slice will modify the memory in the
+original Buffer because the allocated memory of the two objects overlap.**
Example: build a Buffer with the ASCII alphabet, take a slice, then modify one
byte from the original Buffer.
### buf.toString([encoding][, start][, end])
-* `encoding` String, Optional, Default: 'utf8'
-* `start` Number, Optional, Default: 0
-* `end` Number, Optional, Default: `buffer.length`
+* `encoding` {String} Default: `'utf8'`
+* `start` {Number} Default: 0
+* `end` {Number} Default: `buffer.length`
+* Return: {String}
Decodes and returns a string from the Buffer data using the specified
-character set `encoding`. If `encoding` is `undefined` or `null`, then
-`encoding` defaults to `'utf8'`. The `start` and `end` parameters default to
-`0` and `buffer.length` when `undefined`.
+character set `encoding`.
```js
const buf = new Buffer(26);
### buf.toJSON()
+* Return: {Object}
+
Returns a JSON representation of the Buffer instance. `JSON.stringify`
implicitly calls this function when stringifying a Buffer instance.
// Prints: 'test'
```
+### buf.values()
+
+* Return: {Iterator}
+
+Creates and returns an [iterator][] for Buffer values (bytes). This function is
+called automatically when the Buffer is used in a `for..of` statement.
+
+```js
+const buf = new Buffer('buffer');
+for (var value of buf.values()) {
+ console.log(value);
+}
+// prints:
+// 98
+// 117
+// 102
+// 102
+// 101
+// 114
+
+for (var value of buf) {
+ console.log(value);
+}
+// prints:
+// 98
+// 117
+// 102
+// 102
+// 101
+// 114
+```
+
### buf.write(string[, offset][, length][, encoding])
-* `string` String - data to be written to buffer
-* `offset` Number, Optional, Default: 0
-* `length` Number, Optional, Default: `buffer.length - offset`
-* `encoding` String, Optional, Default: 'utf8'
+* `string` {String} Bytes to be written to buffer
+* `offset` {Number} Default: 0
+* `length` {Number} Default: `buffer.length - offset`
+* `encoding` {String} Default: `'utf8'`
+* Return: {Number} Numbers of bytes written
Writes `string` to the Buffer at `offset` using the given `encoding`.
-When undefined, `offset` defaults to `0`, and `encoding` defaults to `'utf8'`.
-The `length` parameter is the number of bytes to write, when undefined `length`
-defaults to `buffer.length - offset`. If the Buffer did not contain enough
-space to fit the entire string, only a partial amount of the string will be
-written however, it will not write only partially encoded characters. The
-return value indicates the number of octets written.
+The `length` parameter is the number of bytes to write. If the Buffer did not
+contain enough space to fit the entire string, only a partial amount of the
+string will be written however, it will not write only partially encoded
+characters.
```js
const buf = new Buffer(256);
### buf.writeDoubleBE(value, offset[, noAssert])
### buf.writeDoubleLE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 8`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeDoubleBE()` writes big endian, `writeDoubleLE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
Example:
### buf.writeFloatBE(value, offset[, noAssert])
### buf.writeFloatLE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeFloatBE()` writes big endian, `writeFloatLE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
Example:
### buf.writeInt8(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 1`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset`. The `value` must be a
valid signed 8-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
The `value` is interpreted and written as a two's complement signed integer.
### buf.writeInt16BE(value, offset[, noAssert])
### buf.writeInt16LE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 2`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt16BE()` writes big endian, `writeInt16LE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
The `value` is interpreted and written as a two's complement signed integer.
### buf.writeInt32BE(value, offset[, noAssert])
### buf.writeInt32LE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeInt32BE()` writes big endian, `writeInt32LE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
The `value` is interpreted and written as a two's complement signed integer.
### buf.writeIntLE(value, offset, byteLength[, noAssert])
* `value` {Number} Bytes to be written to Buffer
-* `offset` {Number} `0 <= offset <= buf.length`
+* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
-* Return: {Number}
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` and `byteLength`.
Supports up to 48 bits of accuracy. For example:
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
### buf.writeUInt8(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 1`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset`. The `value` must be a
valid unsigned 8-bit integer.
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
Example:
### buf.writeUInt16BE(value, offset[, noAssert])
### buf.writeUInt16LE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 2`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt16BE()` writes big endian, `writeUInt16LE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
Example:
### buf.writeUInt32BE(value, offset[, noAssert])
### buf.writeUInt32LE(value, offset[, noAssert])
-* `value` Number
-* `offset` Number
-* `noAssert` Boolean, Optional, Default: false
+* `value` {Number} Bytes to be written to Buffer
+* `offset` {Number} `0 <= offset <= buf.length - 4`
+* `noAssert` {Boolean} Default: false
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` with specified endian
format (`writeUInt32BE()` writes big endian, `writeUInt32LE()` writes little
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
Example:
### buf.writeUIntLE(value, offset, byteLength[, noAssert])
* `value` {Number} Bytes to be written to Buffer
-* `offset` {Number} `0 <= offset <= buf.length`
+* `offset` {Number} `0 <= offset <= buf.length - byteLength`
* `byteLength` {Number} `0 < byteLength <= 6`
* `noAssert` {Boolean} Default: false
-* Return: {Number}
+* Return: {Number} Numbers of bytes written
Writes `value` to the Buffer at the specified `offset` and `byteLength`.
Supports up to 48 bits of accuracy. For example:
Set `noAssert` to true to skip validation of `value` and `offset`. This means
that `value` may be too large for the specific function and `offset` may be
beyond the end of the Buffer leading to the values being silently dropped. This
-should not be used unless you are certain of correctness. Defaults to `false`.
+should not be used unless you are certain of correctness.
## buffer.INSPECT_MAX_BYTES
-* Number, Default: 50
+* {Number} Default: 50
Returns the maximum number of bytes that will be returned when
`buffer.inspect()` is called. This can be overridden by user modules. See