static void serialize(ByteBuffer outputBuffer, EncryptedDataPayload encryptedDataPayload) {
      int startOffset = outputBuffer.position();
      outputBuffer.putShort(CURRENT_VERSION);
      int encryptedKeySize = encryptedDataPayload.encryptedKey.array().length;
      int encryptedDataSize = encryptedDataPayload.encryptedData.array().length;
      outputBuffer.putInt(encryptedKeySize);
      outputBuffer.putLong(encryptedDataSize);
      outputBuffer.put(encryptedDataPayload.encryptedKey);
      outputBuffer.put(encryptedDataPayload.encryptedData);
      CRC32 crc = new CRC32();
      crc.update(outputBuffer.array(), startOffset, INITIAL_MESSAGE_LENGTH + encryptedKeySize + encryptedDataSize);
      outputBuffer.putLong(crc.getValue());
    }
Serialize the {@link EncryptedDataPayload} into an output buffer.
@param outputBuffer the {@link ByteBuffer} to write to.  Currently, only HeapByteBuffer is supported.
@param encryptedDataPayload the {@link EncryptedDataPayload} to serialize.
ambry-cloud/src/main/java/com/github/ambry/cloud/CloudBlobCryptoAgentImpl.java