Source:
<code>private Message newMessage(InputStream inputStream, StoreKey newKey, MessageInfo oldMessageInfo) throws IOException, MessageFormatException { MessageHeader_Format headerFormat = getMessageHeader(inputStream); storeKeyFactory.getStoreKey(new DataInputStream(inputStream)); BlobId newBlobId = (BlobId) newKey; if (headerFormat.isPutRecord()) { ByteBuffer blobEncryptionKey = null; if (headerFormat.hasEncryptionKeyRecord()) { blobEncryptionKey = deserializeBlobEncryptionKey(inputStream); } BlobProperties oldProperties = deserializeBlobProperties(inputStream); BlobProperties newProperties = new BlobProperties(oldProperties.getBlobSize(), oldProperties.getServiceId(), oldProperties.getOwnerId(), oldProperties.getContentType(), oldProperties.isPrivate(), oldProperties.getTimeToLiveInSeconds(), oldProperties.getCreationTimeInMs(), newBlobId.getAccountId(), newBlobId.getContainerId(), oldProperties.isEncrypted()); ByteBuffer userMetaData = deserializeUserMetadata(inputStream); BlobData blobData = deserializeBlob(inputStream); PutMessageFormatInputStream putMessageFormatInputStream = new PutMessageFormatInputStream(newKey, blobEncryptionKey, newProperties, userMetaData, blobData.getStream(), blobData.getSize(), blobData.getBlobType()); <START> Long crc = oldMessageInfo.getStoreKey().getID().equals(newKey.getID()) ? oldMessageInfo.getCrc() : null; <END> MessageInfo info = new MessageInfo(newKey, putMessageFormatInputStream.getSize(), false, oldMessageInfo.isTtlUpdated(), oldMessageInfo.getExpirationTimeInMs(), crc, newProperties.getAccountId(), newProperties.getContainerId(), oldMessageInfo.getOperationTimeMs()); return new Message(info, putMessageFormatInputStream); } else { throw new IllegalArgumentException("Only 'put' records are valid"); } }</code><technical_language>want point out if key changes - crc blob is deserialized re-serialized (sometimes in a new format). I if call field in MessageInfo other crc actual crc</technical_language>

Target:
private Message newMessage(InputStream inputStream, StoreKey newKey, MessageInfo oldMessageInfo) throws IOException, MessageFormatException { MessageHeader_Format headerFormat = getMessageHeader(inputStream); storeKeyFactory.getStoreKey(new DataInputStream(inputStream)); BlobId newBlobId = (BlobId) newKey; if (headerFormat.isPutRecord()) { ByteBuffer blobEncryptionKey = null; if (headerFormat.hasEncryptionKeyRecord()) { blobEncryptionKey = deserializeBlobEncryptionKey(inputStream); } BlobProperties oldProperties = deserializeBlobProperties(inputStream); BlobProperties newProperties = new BlobProperties(oldProperties.getBlobSize(), oldProperties.getServiceId(), oldProperties.getOwnerId(), oldProperties.getContentType(), oldProperties.isPrivate(), oldProperties.getTimeToLiveInSeconds(), oldProperties.getCreationTimeInMs(), newBlobId.getAccountId(), newBlobId.getContainerId(), oldProperties.isEncrypted()); ByteBuffer userMetaData = deserializeUserMetadata(inputStream); BlobData blobData = deserializeBlob(inputStream); PutMessageFormatInputStream putMessageFormatInputStream = new PutMessageFormatInputStream(newKey, blobEncryptionKey, newProperties, userMetaData, blobData.getStream(), blobData.getSize(), blobData.getBlobType()); Long originalCrc = oldMessageInfo.getStoreKey().getID().equals(newKey.getID()) ? oldMessageInfo.getCrc() : null; MessageInfo info = new MessageInfo(newKey, putMessageFormatInputStream.getSize(), false, oldMessageInfo.isTtlUpdated(), oldMessageInfo.getExpirationTimeInMs(), originalCrc, newProperties.getAccountId(), newProperties.getContainerId(), oldMessageInfo.getOperationTimeMs()); return new Message(info, putMessageFormatInputStream); } else { throw new IllegalArgumentException("Only 'put' records are valid"); } }