static PutRequest readFrom(DataInputStream stream, ClusterMap map) throws IOException {
      int correlationId = stream.readInt();
      String clientId = Utils.readIntString(stream);
      CrcInputStream crcInputStream = new CrcInputStream(stream);
      stream = new DataInputStream(crcInputStream);
      BlobId id = new BlobId(stream, map);
      BlobProperties properties = BlobPropertiesSerDe.getBlobPropertiesFromStream(stream);
      int mdSize = stream.readInt();
      ByteBuffer metadata = Utils.readByteBufferFromCrcInputStream(crcInputStream, mdSize);
      BlobType blobType = BlobType.values()[stream.readShort()];
      ByteBuffer blobEncryptionKey = Utils.readShortBuffer(stream);
      boolean isCompressed = stream.readByte() == 1;
      long blobSize = stream.readLong();
      ByteBufferInputStream blobStream =
          Utils.getByteBufferInputStreamFromCrcInputStream(crcInputStream, (int) blobSize);
      long computedCrc = crcInputStream.getValue();
      long receivedCrc = stream.readLong();
      if (computedCrc != receivedCrc) {
        throw new IOException("CRC mismatch, data in PutRequest is unreliable");
      }
      return new PutRequest(correlationId, clientId, id, properties, metadata, blobSize, blobType,
          blobEncryptionKey.remaining() == 0 ? null : blobEncryptionKey, blobStream, receivedCrc, isCompressed);
    }
Class to read protocol version 5 PutRequest from the stream.
ambry-protocol/src/main/java/com/github/ambry/protocol/PutRequest.java