@Override
    public void write(int value) {
        bos.write(value);
    }
@Test
    public void serializeByteArrayWithLengthExceedingWithNonZerosShouldThrowException() throws IOException {
        thrown.expect(Asn1Exception.class);
        thrown.expectMessage("Length is smaller than length of buffer, ignoring 0 leading zeros: 2 < 3");
        assertArrayEquals(new byte[] {1, 2}, write( (o) -> o.write(new byte[] { 1, 1, 2}, 2)));
    }