}
allocator.allocate(mutation, (int) totalSize, alloc);
try
{
PureJavaCrc32 checksum = new PureJavaCrc32();
final ByteBuffer buffer = alloc.getBuffer();
DataOutputByteBuffer dos = new DataOutputByteBuffer(buffer);
// checksummed length
dos.writeInt((int) size);
checksum.update(buffer, buffer.position() - 4, 4);
buffer.putLong(checksum.getValue());
int start = buffer.position();
// checksummed mutation
Mutation.serializer.serialize(mutation, dos, MessagingService.current_version);
checksum.update(buffer, start, (int) size);
buffer.putLong(checksum.getValue());
}
catch (IOException e)
{
throw new FSWriteError(e, alloc.getSegment().getPath());
}