public void writeFiveByteULong(long v) {
    if (isAllInOneWriteBuffer(5)) {
      writePos.buffer[writePos.offset] = (byte)(v >>> 32);
      writePos.buffer[writePos.offset + 1] = (byte)(v >>> 24);
      writePos.buffer[writePos.offset + 2] = (byte)(v >>> 16);
      writePos.buffer[writePos.offset + 3] = (byte)(v >>> 8);
      writePos.buffer[writePos.offset + 4] = (byte)(v);
      writePos.offset += 5;
    } else {
      write((byte)(v >>> 32));
      write((byte)(v >>> 24));
      write((byte)(v >>> 16));
      write((byte)(v >>> 8));
      write((byte)(v));
    }
  }
THIS METHOD IS NOT THREAD-SAFE. Use only at load time (or be mindful of thread safety).
serde/src/java/org/apache/hadoop/hive/serde2/WriteBuffers.java