text: exports.encodeInt = function(value) {
    var buffer = new Buffer(4);
    buffer[3] = (value >> 24) & 0xff;      
    buffer[2] = (value >> 16) & 0xff;
    buffer[1] = (value >> 8) & 0xff;
    buffer[0] = value & 0xff;
    return buffer;
  }
  
  exports.encodeIntInPlace = function(value, buffer, index) {
    buffer[index + 3] = (value >> 24) & 0xff;			
  	buffer[index + 2] = (value >> 16) & 0xff;
  	buffer[index + 1] = (value >> 8) & 0xff;
  	buffer[index] = value & 0xff;
  }
  
  exports.encodeCString = function(string) {
    var buf = new Buffer(string, 'utf8');
    return [buf, new Buffer([0])];
  }
  
  exports.decodeUInt32 = function(array, index) {
    return array[index] | array[index + 1] << 8 | array[index + 2] << 16 | array[index + 3] << 24;
  }
  
  // Decode the int
  exports.decodeUInt8 = function(array, index) {
    return array[index];
  }
  