static byte [] runEncoderTest(final int index, final int initialBufferSize, final ByteArrayOutputStream baos, final CellOutputStream encoder, final Cell [] cells) throws IOException { long startTime = System.currentTimeMillis(); for (int i = 0; i < cells.length; i++) { encoder.write(cells[i]); } encoder.flush(); LOG.info("" + index + " encoded count=" + cells.length + " in " + (System.currentTimeMillis() - startTime) + "ms for encoder " + encoder); // Ensure we did not have to grow the backing buffer. assertTrue(baos.size() < initialBufferSize); return baos.toByteArray(); }