@Test public void encode() { codec = new AsnUintCodecUL(); codec.encode(UnsignedLong.ONE); assertThat(codec.getBytes()).isEqualTo(new byte[] {1}); }
@Override public void encode(final UnsignedLong value) { byte[] bytes = value.bigIntegerValue().toByteArray(); if (bytes[0] == 0x00 && bytes.length > 1) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(bytes, 1, bytes.length - 1); setBytes(baos.toByteArray()); return; } setBytes(bytes); }
AsnUintCodecUL extends AsnOctetStringBasedObjectCodec<UnsignedLong> { @Override public void encode(final UnsignedLong value) { byte[] bytes = value.bigIntegerValue().toByteArray(); if (bytes[0] == 0x00 && bytes.length > 1) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(bytes, 1, bytes.length - 1); setBytes(baos.toByteArray()); return; } setBytes(bytes); } }
AsnUintCodecUL extends AsnOctetStringBasedObjectCodec<UnsignedLong> { @Override public void encode(final UnsignedLong value) { byte[] bytes = value.bigIntegerValue().toByteArray(); if (bytes[0] == 0x00 && bytes.length > 1) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(bytes, 1, bytes.length - 1); setBytes(baos.toByteArray()); return; } setBytes(bytes); } AsnUintCodecUL();  AsnUintCodecUL(final UnsignedLong defaultValue); }
AsnUintCodecUL extends AsnOctetStringBasedObjectCodec<UnsignedLong> { @Override public void encode(final UnsignedLong value) { byte[] bytes = value.bigIntegerValue().toByteArray(); if (bytes[0] == 0x00 && bytes.length > 1) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(bytes, 1, bytes.length - 1); setBytes(baos.toByteArray()); return; } setBytes(bytes); } AsnUintCodecUL();  AsnUintCodecUL(final UnsignedLong defaultValue); @Override UnsignedLong decode(); @Override void encode(final UnsignedLong value); }
AsnUintCodecUL extends AsnOctetStringBasedObjectCodec<UnsignedLong> { @Override public void encode(final UnsignedLong value) { byte[] bytes = value.bigIntegerValue().toByteArray(); if (bytes[0] == 0x00 && bytes.length > 1) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(bytes, 1, bytes.length - 1); setBytes(baos.toByteArray()); return; } setBytes(bytes); } AsnUintCodecUL();  AsnUintCodecUL(final UnsignedLong defaultValue); @Override UnsignedLong decode(); @Override void encode(final UnsignedLong value);  }