code: function Message(payload, checksum, magic, compression){
    // note: payload should be a Buffer
    var _compression = COMPRESSION_DEFAULT;
  
    // compression:
    // 0 = none; 1 = gzip; 2 = snappy;
    // Only exists at all if MAGIC == 1
    if (!!magic && magic == 1){
      if (_.include([0,1,2], compression)){
        _compression = compression;
      } else {
        throw "InvalidCompressionType: " + compression;
      }
    }
    this.compression = _compression;
    this.MAGIC_IDENTIFIER_DEFAULT = 1;
    if (magic === undefined){ 
      this.magic = this.MAGIC_IDENTIFIER_DEFAULT;
    } else { 
      this.magic = magic;
    }
    if (this.magic !== 0 && this.magic !== 1){
      throw "Unsupported Kafka message version: " + this.magic;
    }
    if (!payload && payload !== ''){
      throw "payload is a required argument";
    }
    this.payload = payload;
    this.checksum = checksum || this.calculateChecksum();
  }
docs: /*
  A message. The format of an N byte message is the following:
  1 byte "magic" identifier to allow format changes
  4 byte CRC32 of the payload
  N - 5 byte payload