private int sizeExcludingBlobAndCrcSize() {
    // size of (header + blobId + blob properties + metadata size + metadata + blob size + blob type)
    if (sizeExcludingBlobAndCrc == -1) {
      sizeExcludingBlobAndCrc =
          (int) super.sizeInBytes() + blobId.sizeInBytes() + BlobPropertiesSerDe.getBlobPropertiesSerDeSize(properties)
              + USERMETADATA_SIZE_IN_BYTES + usermetadata.capacity() + BLOB_SIZE_IN_BYTES + BLOBTYPE_SIZE_IN_BYTES;
      sizeExcludingBlobAndCrc += BLOBKEYLENGTH_SIZE_IN_BYTES;
      if (blobEncryptionKey != null) {
        sizeExcludingBlobAndCrc += blobEncryptionKey.remaining();
      }
      if (versionId >= PUT_REQUEST_VERSION_V5) {
        sizeExcludingBlobAndCrc += IS_COMPRESSED_SIZE_IN_BYTES;
      }
    }
    return sizeExcludingBlobAndCrc;
  }
Deserialize {@link PutRequest} from a given {@link DataInputStream}.
@param stream The stream that contains the serialized bytes.
@param map The {@link ClusterMap} to help build {@link BlobId}.
@return A deserialized {@link PutRequest}.
@throws IOException Any I/O Errors.
ambry-protocol/src/main/java/com/github/ambry/protocol/PutRequest.java