public int sizeInBytes() {
    return Short.BYTES + Integer.BYTES + (encryptionKey == null ? 0 : encryptionKey.remaining());
  }
@return The number of bytes in the serialized form of this instance of MessageMetadata.
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageMetadata.java