@Override
  public void close() throws IOException {
    finish();
    os.close();
  }
@Test
  public void testClosingFinishesTheStream() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BufferedElementCountingOutputStream os = createAndWriteValues(toBytes("abcdefghij"), baos);
    os.close();
    verifyValues(toBytes("abcdefghij"), new ByteArrayInputStream(baos.toByteArray()));
  }