public static PutRequest readFrom(DataInputStream stream, ClusterMap map) throws IOException {
    short versionId = stream.readShort();
    switch (versionId) {
      case PUT_REQUEST_VERSION_V3:
        return PutRequest_V3.readFrom(stream, map);
      case PUT_REQUEST_VERSION_V4:
        return PutRequest_V4.readFrom(stream, map);
      case PUT_REQUEST_VERSION_V5:
        return PutRequest_V5.readFrom(stream, map);
      default:
        throw new IllegalStateException("Unknown Request response version" + versionId);
    }
  }
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