From 3567ff1378f46608d00cd17c712496ed737dc370 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sun, 31 Mar 2019 17:06:01 +0300 Subject: [PATCH] doc: mark optional parameters in buffer.md PR-URL: https://github.com/nodejs/node/pull/27030 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Signed-off-by: Beth Griggs --- doc/api/buffer.md | 88 +++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index c626ba5e0dadd9..4200557a2036cf 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1541,8 +1541,8 @@ deprecated: v8.0.0 The `buf.parent` property is a deprecated alias for `buf.buffer`. -### buf.readDoubleBE(offset) -### buf.readDoubleLE(offset) +### buf.readDoubleBE([offset]) +### buf.readDoubleLE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 8`. + satisfy `0 <= offset <= buf.length - 8`. **Default:** `0`. * Returns: {number} Reads a 64-bit double from `buf` at the specified `offset` with specified @@ -1571,8 +1571,8 @@ console.log(buf.readDoubleLE(1)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readFloatBE(offset) -### buf.readFloatLE(offset) +### buf.readFloatBE([offset]) +### buf.readFloatLE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 4`. + satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`. * Returns: {number} Reads a 32-bit float from `buf` at the specified `offset` with specified @@ -1601,7 +1601,7 @@ console.log(buf.readFloatLE(1)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readInt8(offset) +### buf.readInt8([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 1`. + satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`. * Returns: {integer} Reads a signed 8-bit integer from `buf` at the specified `offset`. @@ -1630,8 +1630,8 @@ console.log(buf.readInt8(2)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readInt16BE(offset) -### buf.readInt16LE(offset) +### buf.readInt16BE([offset]) +### buf.readInt16LE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 2`. + satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`. * Returns: {integer} Reads a signed 16-bit integer from `buf` at the specified `offset` with @@ -1662,8 +1662,8 @@ console.log(buf.readInt16LE(1)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readInt32BE(offset) -### buf.readInt32LE(offset) +### buf.readInt32BE([offset]) +### buf.readInt32LE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 4`. + satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`. * Returns: {integer} Reads a signed 32-bit integer from `buf` at the specified `offset` with @@ -1728,7 +1728,7 @@ console.log(buf.readIntBE(1, 0).toString(16)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readUInt8(offset) +### buf.readUInt8([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 1`. + satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`. * Returns: {integer} Reads an unsigned 8-bit integer from `buf` at the specified `offset`. @@ -1755,8 +1755,8 @@ console.log(buf.readUInt8(2)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readUInt16BE(offset) -### buf.readUInt16LE(offset) +### buf.readUInt16BE([offset]) +### buf.readUInt16LE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 2`. + satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`. * Returns: {integer} Reads an unsigned 16-bit integer from `buf` at the specified `offset` with @@ -1789,8 +1789,8 @@ console.log(buf.readUInt16LE(2).toString(16)); // Throws ERR_OUT_OF_RANGE ``` -### buf.readUInt32BE(offset) -### buf.readUInt32LE(offset) +### buf.readUInt32BE([offset]) +### buf.readUInt32LE([offset]) * `offset` {integer} Number of bytes to skip before starting to read. Must - satisfy `0 <= offset <= buf.length - 4`. + satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`. * Returns: {integer} Reads an unsigned 32-bit integer from `buf` at the specified `offset` with @@ -2144,8 +2144,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); // Prints: 12 bytes: ½ + ¼ = ¾ ``` -### buf.writeDoubleBE(value, offset) -### buf.writeDoubleLE(value, offset) +### buf.writeDoubleBE(value[, offset]) +### buf.writeDoubleLE(value[, offset])