Files
node/doc/api
James M Snell 7d73e60f60 buffer: add swap16() and swap32() methods
Adds Buffer.prototype.swap16() and Buffer.prototype.swap32()
methods that mutate the Buffer instance in-place by swapping the
16-bit and 32-bit byte-order.

Example:

```js
const buf = Buffer([0x1, 0x2, 0x3, 0x4]);
buf.swap16();
console.log(buf);
  // prints Buffer(0x2, 0x1, 0x4, 0x3);

buf.swap32();
console.log(buf);
  // prints Buffer(0x3, 0x4, 0x1, 0x2);
```

PR-URL: https://github.com/nodejs/node/pull/5724
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-03-23 08:52:44 -07:00
..
2016-03-21 17:33:42 -04:00
2016-03-14 08:48:08 -07:00
2015-08-04 11:56:14 -07:00
2016-03-21 17:33:42 -04:00
2016-03-14 08:48:03 -07:00
2016-03-10 14:09:26 +01:00
2016-03-22 23:26:27 +02:00
2016-03-20 11:49:02 +02:00
2016-03-10 14:09:26 +01:00
2010-11-07 17:22:56 -08:00
2016-03-18 11:04:02 -05:00
2016-02-04 19:25:07 +01:00
2016-03-02 23:22:29 +01:00
2016-02-21 14:59:35 -05:00