Skip to content

Commit ba5e0b6

Browse files
chinedufnMyles Borins
authored and
Myles Borins
committed
doc: fix buf.readInt16LE output
Previous example didn't account for the 1 byte offset PR-URL: #5282 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 1624d5b commit ba5e0b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/buffer.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ const buf = new Buffer([1,-2,3,4]);
715715
buf.readInt16BE();
716716
// returns 510
717717
buf.readInt16LE(1);
718-
// returns -511
718+
// returns 1022
719719
```
720720

721721
### buf.readInt32BE(offset[, noAssert])

0 commit comments

Comments
 (0)