byte[] toBytes() {
    byte[] nameBytes = name.toString().getBytes(StandardCharsets.UTF_8);
    int size = VERSION_SIZE + NAME_LENGTH_SIZE + nameBytes.length + OFFSET_SIZE;
    byte[] bytes = new byte[size];
    ByteBuffer buf = ByteBuffer.wrap(bytes);
    buf.putShort(CURRENT_VERSION);
    buf.putInt(nameBytes.length);
    buf.put(nameBytes);
    buf.putLong(offset);
    return bytes;
  }
Converts this object into its byte representation.
@return the byte representation of this object.
ambry-store/src/main/java/com/github/ambry/store/Offset.java