@Override public void readFields(DataInput dataInput) throws IOException {
    timestamp = dataInput.readLong();
    partition = dataInput.readInt();
    offset = dataInput.readLong();
    int dataSize = dataInput.readInt();
    if (dataSize > 0) {
      value = new byte[dataSize];
      dataInput.readFully(value);
    } else {
      value = new byte[0];
    }
    int keyArraySize = dataInput.readInt();
    if (keyArraySize > -1) {
      recordKey = new byte[keyArraySize];
      dataInput.readFully(recordKey);
    } else {
      recordKey = null;
    }
  }
Writable implementation of Kafka ConsumerRecord.
Serialized in the form:
{@code timestamp} long| {@code partition} (int) | {@code offset} (long) | {@code value.size()} (int) |
{@code value} (byte []) | {@code recordKey.size()}| {@code recordKey (byte [])}
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaWritable.java