codec.osMap = osMap;
int counter = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
BitOutputStream bos = new DefaultBitOutputStream(baos);
Iterator<CramRecord> iterator = records.iterator();
long time1 = System.nanoTime();
while (iterator.hasNext()) {
for (int i = 0; i < recordsPerSlice; i++) {
if (!iterator.hasNext())
break;
CramRecord record = iterator.next();
codec.write(bos, record);
counter++;
}
bos.close();
block = new Block();
block.contentType = ContentType.CORE.getContentType();
block.contentId = 0;
block.data = baos.toByteArray();
block.method = CompressionMethod.GZIP.byteValue();