private byte[] toBytes() {
    byte[] incarnationIdBytes = incarnationId.toString().getBytes();
    int size = VERSION_SIZE + INCARNATION_ID_LENGTH_SIZE + incarnationIdBytes.length;
    byte[] buf = new byte[size];
    ByteBuffer bufWrap = ByteBuffer.wrap(buf);
    // add version
    bufWrap.putShort(VERSION_0);
    // add incarnationId
    bufWrap.putInt(incarnationIdBytes.length);
    bufWrap.put(incarnationIdBytes);
    return buf;
  }
Returns the serialized form of this {@link StoreDescriptor}
@return the serialized form of this {@link StoreDescriptor}
ambry-store/src/main/java/com/github/ambry/store/StoreDescriptor.java