@Override
    public void write(int value) {
        bos.write(value);
    }
@Test
    public void serializeByteArrayWithExactLength() throws IOException {
        assertArrayEquals(new byte[] {1, 2}, write( (o) -> o.write(new byte[] { 1, 2}, 2)));

    }