lib/packets.js
function Packet(length) {
    this._index = 0;
    if (length instanceof Buffer) {
        this.buf = length;
    } else {
        this.buf = Buffer.alloc(length, 0);

        this.writeInt32LE(length);
    }
}
function Packet(length) {
    this._index = 0;
    if (length instanceof Buffer) {
        this.buf = length;
    } else {
        this.buf = Buffer.alloc(length, 0);

        this.writeInt32LE(length);
    }
}
function Packet ( length ) { this . _index = 0 ; if ( length instanceof Buffer ) { this . buf = length ; } else { this . buf = Buffer . alloc ( length , 0 ) ; this . writeInt32LE ( length ) ; } }
Utility for creating and reading TCP packets
Utility for creating and reading TCP packets