Source:
void handleBody(InputStream payload, MessageMetadata messageMetadata, MessageInfo messageInfo) throws IOException, MessageFormatException { if (!successfullyDeserialized) { BlobData blobData; ByteBuffer encryptionKey; byte[] userMetadata = null; ByteBuffer rawPayloadBuffer = null; boolean rawMode = options.getBlobOptions.isRawMode(); if (rawMode) { byte[] payloadBytes = new byte[payload.available()]; payload.read(payloadBytes); payload = new ByteArrayInputStream(payloadBytes); rawPayloadBuffer = ByteBuffer.wrap(payloadBytes); } if (getOperationFlag() == MessageFormatFlags.Blob) { blobData = MessageFormatRecord.deserializeBlob(payload); encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); } else { BlobAll blobAll = MessageFormatRecord.deserializeBlobAll(payload, blobIdFactory); BlobInfo serverBlobInfo = blobAll.getBlobInfo(); updateTtlIfRequired(serverBlobInfo.getBlobProperties(), messageInfo); getOptions().ageAtAccessTracker.trackAgeAtAccess(serverBlobInfo.getBlobProperties().getCreationTimeInMs()); blobData = blobAll.getBlobData(); encryptionKey = blobAll.getBlobEncryptionKey(); if (encryptionKey == null) { blobInfo = serverBlobInfo; } else { serverBlobProperties = serverBlobInfo.getBlobProperties(); userMetadata = serverBlobInfo.getUserMetadata(); } } blobType = blobData.getBlobType(); chunkIndexToBuffer = new TreeMap<>(); if (blobType == BlobType.MetadataBlob) { if (rawMode) { chunkIndexToBuffer.put(0, blobData.getStream().getByteBuffer()); numChunksRetrieved = 1; } else { handleMetadataBlob(blobData, userMetadata, encryptionKey); } } else { if (rawMode) { if (encryptionKey != null) { chunkIndexToBuffer.put(0, rawPayloadBuffer); numChunksRetrieved = 1; } else { setOperationException(new IllegalStateException("Only encrypted blobs supported in raw mode")); } } else { handleSimpleBlob(blobData, userMetadata, encryptionKey); } } successfullyDeserialized = true; } else { } }

Target:
void handleBody(InputStream payload, MessageMetadata messageMetadata, MessageInfo messageInfo) throws IOException, MessageFormatException { if (!successfullyDeserialized) { BlobData blobData; ByteBuffer encryptionKey; byte[] userMetadata = null; ByteBuffer rawPayloadBuffer = null; boolean rawMode = options.getBlobOptions.isRawMode(); if (rawMode) { if (messageInfo.getSize() > Integer.MAX_VALUE) { throw new IllegalStateException("Payload too large for blob " + blobId.getID()); } byte[] payloadBytes = new byte[(int) messageInfo.getSize()]; payload.read(payloadBytes); payload = new ByteArrayInputStream(payloadBytes); rawPayloadBuffer = ByteBuffer.wrap(payloadBytes); } if (getOperationFlag() == MessageFormatFlags.Blob) { blobData = MessageFormatRecord.deserializeBlob(payload); encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); } else { BlobAll blobAll = MessageFormatRecord.deserializeBlobAll(payload, blobIdFactory); BlobInfo serverBlobInfo = blobAll.getBlobInfo(); updateTtlIfRequired(serverBlobInfo.getBlobProperties(), messageInfo); getOptions().ageAtAccessTracker.trackAgeAtAccess(serverBlobInfo.getBlobProperties().getCreationTimeInMs()); blobData = blobAll.getBlobData(); encryptionKey = blobAll.getBlobEncryptionKey(); if (encryptionKey == null) { blobInfo = serverBlobInfo; } else { serverBlobProperties = serverBlobInfo.getBlobProperties(); userMetadata = serverBlobInfo.getUserMetadata(); } } blobType = blobData.getBlobType(); chunkIndexToBuffer = new TreeMap<>(); if (rawMode) { if (encryptionKey != null) { chunkIdIterator = null; dataChunks = null; chunkIndex = 0; numChunksTotal = 1; chunkIndexToBuffer.put(0, rawPayloadBuffer); numChunksRetrieved = 1; } else { setOperationException(new IllegalStateException("Only encrypted blobs supported in raw mode")); } } else { if (blobType == BlobType.MetadataBlob) { handleMetadataBlob(blobData, userMetadata, encryptionKey); } else { handleSimpleBlob(blobData, userMetadata, encryptionKey); } } successfullyDeserialized = true; } else { } }