src/SourceCon.js
function pack(id, type, body) {
    var buf = new Buffer(body.length + 14);
    buf.writeInt32LE(body.length + 10, 0);
    buf.writeInt32LE(id, 4);
    buf.writeInt32LE(type, 8);
    body.copy(buf, 12);
    buf[buf.length-2] = 0;
    buf[buf.length-1] = 0;
    return buf;
}
function pack(id, type, body) {
    var buf = new Buffer(body.length + 14);
    buf.writeInt32LE(body.length + 10, 0);
    buf.writeInt32LE(id, 4);
    buf.writeInt32LE(type, 8);
    body.copy(buf, 12);
    buf[buf.length-2] = 0;
    buf[buf.length-1] = 0;
    return buf;
}
function pack ( id , type , body ) { var buf = new Buffer ( body . length + 14 ) ; buf . writeInt32LE ( body . length + 10 , 0 ) ; buf . writeInt32LE ( id , 4 ) ; buf . writeInt32LE ( type , 8 ) ; body . copy ( buf , 12 ) ; buf [ buf . length - 2 ] = 0 ; buf [ buf . length - 1 ] = 0 ; return buf ; }
Creates a request packet.
@param {number} id Request id
@param {number} type Request type
@param {!Buffer} body Request data
@returns {!Buffer}
Creates a request packet .