joyent/node — Issue #2183: Buffer.readInt8 is little endian only
Author: ynk
Created: 2011-11-24 23:36:54+00:00
State: open

Fix proposed :

```javascript
Buffer.prototype.readInt8LE = Buffer.prototype.readInt8;
Buffer.prototype.readInt8BE = function(index)
{
return	(this[index + 0] << 8) +
this[index + 1];
}

Buffer.prototype.writeInt8LE = Buffer.prototype.writeInt8;
Buffer.prototype.writeInt8BE = function(value, at)
{
if (typeof at == 'undefined') { at = 0; }

var bytes = new Array(4)
bytes[at + 0] = value >> 8
bytes[at + 1] = value;

this.write(new Buffer(bytes));
};
```