Ben Noordhuis
96a314b68b
buffer: strip high bits when converting to ascii
Consider the following example:
console.log(Buffer('ú').toString('ascii'));
Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.
Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.
Fixes #4371 .
12 years ago
Ben Noordhuis
3f7e88a852
buffer: accept negative indices in Buffer#slice()
A negative start or end parameter now indexes from the end of the
buffer. More in line with String#slice() and ArrayBuffer#slice().
12 years ago
Ben Noordhuis
30b0bc4fa9
doc: update buffer/typed array documentation
Clarify that typed array constructors accept buffers as their first
argument but that the memory is not shared and why this was changed
in v0.9.
12 years ago
Trevor Norris
49175e6ae2
buffer: clean up copy() asserts and tests
Argument checks were simplified by setting all undefined/NaN or out of
bounds values equal to their defaults.
Also copy() tests had a flaw that each buffer had the same bit pattern at
the same offset. So even if the copy failed, the bit-by-bit comparison
would have still been true. This was fixed by filling each buffer with a
unique value before copy operations.
12 years ago
Trevor Norris
3d286b68be
buffer: remove float write range checks
Removed range checks when writing float values, and removed a few
includes and defines. Also updated api docs to reflect that invalid 32
bit float is an unspecified behavior.
12 years ago
Trevor Norris
bb867c0fa6
doc: Add lines about additonal uses of Buffer
That Buffers can be used with Typed Array Views and DataViews. Included
are a couple simple examples.
Closes #4257 .
12 years ago
Nathan Rajlich
dba47aefa5
docs: fix typo in Buffer#toJSON() docs
12 years ago
Nathan Rajlich
a4ef01df07
buffer: implement Buffer.prototype.toJSON()
Returns an Array-representation of the Buffer.
Closes #3905 .
12 years ago
isaacs
05282588e0
Buffer.isEncoding(enc)
Re: #3918
12 years ago
isaacs
d53cdc5378
Add Buffer.concat method
We write out this loop a lot of places throughout node.
It clearly needs to be an API method.
13 years ago
Jeroen Janssen
1fc2c3823c
doc: updated JavaScript casing where relevant
Fixes #3326 .
13 years ago
isaacs
a3753b496e
Revert "Fix #3242 Actually deprecate 'binary' buffer encoding"
This reverts commit 5979f096d1
.
Related:
- #3279
- #3278
13 years ago
Shigeki Ohtsu
cc8cfb145a
doc: fix typo in buffer documentation
Fixes #3253 .
13 years ago
isaacs
5979f096d1
Fix #3242 Actually deprecate 'binary' buffer encoding
13 years ago
koichik
ebbd4039bc
buffer: add UTF-16LE encoding name.
13 years ago
Kyle Robinson Young
c9e6d3696c
doc: typo fixes
13 years ago
Yoshihiro Kikuchi
c450ac343f
docs: fix using legacy api in the buffer doc
13 years ago
isaacs
674416fbc9
s/buffers/buffer/
13 years ago
isaacs
03d6aa07ea
doc refactor: buffers
13 years ago
isaacs
f9e464f95a
s/buffers/buffer/
13 years ago
isaacs
60aa852a03
doc refactor: buffers
13 years ago
koichik
e1c043f43a
docs: fix docs to not suggest variable leaks
Fixes #2106 .
13 years ago
kyle@dontkry.com
34f34e4411
docs: fix typo
Fixes #2193 .
13 years ago
Ben Noordhuis
9bb3a683fe
docs: improve buffer.fill() documentation
Fixes #1912 .
13 years ago
koichik
530082932d
docs: Added missing parenthesis to buffer.readUInt8 example.
Fixes #1790 .
13 years ago
koichik
4d186f270f
Docs: Not memcpy, but memmove
Fixes #1520 .
13 years ago
Brian White
b7c23ac3f5
Incorporate endianness into buffer.read* function names instead of passing in a boolean flag
13 years ago
Ryan Dahl
2689d262ec
Make buffer.INSPECT_MAX_BYTES public for mscdex
13 years ago
Robert Mustacchi
0df08c6a0c
Endian argument should be a boolean. Signed integers shouldn't run through checks for unsigned integers. Clean up jslint. Provide unchecked uint entry points.
13 years ago
Aku Kotkavuo
562bef5ff3
Add missing parentheses in buffer docs.
Fixes #1405 .
13 years ago
koichik
50e147bd03
Add an optional length argument to Buffer.write()
Fixes #243 .
Fixes #1361 .
13 years ago
koichik
d05afa50e6
Doc improvements
Fixes #297 .
14 years ago
Brian White
e505a1215c
Add reading/writing of floats and doubles from/to buffers
Code for readIEEE754/writeIEEE754 is from jspack: http://code.google.com/p/jspack/
14 years ago
Ryan Dahl
00aee73692
Add docs for buffer.fill()
14 years ago
Robert Mustacchi
9812e31e8b
Add reading/writing of C integers to buffers
14 years ago
Ryan Dahl
af96447016
Modify text about buffer.write and partial chars
Fixes GH-913.
14 years ago
Ryan Dahl
9b3b37e498
Add docs about Buffer._charsWritten
Fixes GH-907.
14 years ago
Ryan Dahl
2f2c9d47fd
Remove strange unicode output in docs
14 years ago
Trevor Burnham
3ec391ba36
Correcting typo in docs: 'deprecated', not 'depreciated'
14 years ago
koichik
5ccdff48f3
Document 'ucs2' encoding for Buffer
14 years ago
isaacs
0aa1a8a005
Closes GH-695 Add 'hex' encoding to Buffer
14 years ago
Ryan Dahl
8f23583d10
A few spelling fixes.
Thanks Bjarki. Closes GH-561.
14 years ago
Ryan Dahl
fca713eba4
Add doc for Buffer.isBuffer
14 years ago
Ryan Dahl
aed0ba3211
buffer.copy targetStart defaults to 0
14 years ago
Ryan Dahl
6d7242b485
Document defaults for buffer.copy()
14 years ago
Silas Sewell
11b2ee7632
Various doc tweaks (2-spaces vs tabs, EOL-whitespace, repl prompt, "world" vs "World", etc...)
14 years ago
Micheil Smith
e190c9616e
Splitting documentation
14 years ago