use of org.openmuc.jasn1.ber.types.BerInteger in project jasn1 by openmuc.
the class BerIntegerTest method explicitEncoding2.
@Test
public void explicitEncoding2() throws IOException {
ReverseByteArrayOutputStream berStream = new ReverseByteArrayOutputStream(50);
BerInteger testInteger = new BerInteger(BigInteger.valueOf(5555));
int length = testInteger.encode(berStream, true);
Assert.assertEquals(4, length);
byte[] expectedBytes = new byte[] { 0x02, 0x02, 0x15, (byte) 0xb3 };
Assert.assertArrayEquals(expectedBytes, berStream.getArray());
}
Aggregations