}
// Write data to dataSegmentOutput
ByteArrayOutputStream dataSegmentOutput = new ByteArrayOutputStream();
for (int s = 0; s < segments; s++) {
DataSegmentWriter writer = new DataSegmentWriter(data[s], codec, null);
writer.writeTo(new DataOutputStream(dataSegmentOutput));
}
// Read dataSegments back to a Buffer
byte[][] newData = new byte[segments][];
ByteArrayInputStream dataSegmentInput =