List<Frame> chunks = Lists.newArrayList();
for (int i = 0; i < chunkCount; i++) {
int offset = i * chunkLength;
ByteBuffer data =
ByteBuffer.wrap(entry, offset, Math.min(chunkLength, entry.length - offset));
chunks.add(Frame.chunk(new FrameChunk(data)));
}
return new Message(chunkSize, header, chunks);
}