@Test public void readZero() throws IOException { InputStream given = new ByteArrayInputStream(new UINT8(BigInteger.valueOf(0)).bytes()); UINT8 expected = new UINT8(BigInteger.valueOf(0)); UINT8 actual = UINT8.read(given); assertThat(actual, is(expected)); }
public static UINT8 read(InputStream is) throws IOException { byte[] bytes = new byte[SIZE_IN_BYTES]; if (is.read(bytes) != SIZE_IN_BYTES) { throw new EOFException(); } return new UINT8(bytes); }
UINT8 extends PtpInteger { public static UINT8 read(InputStream is) throws IOException { byte[] bytes = new byte[SIZE_IN_BYTES]; if (is.read(bytes) != SIZE_IN_BYTES) { throw new EOFException(); } return new UINT8(bytes); } }
UINT8 extends PtpInteger { public static UINT8 read(InputStream is) throws IOException { byte[] bytes = new byte[SIZE_IN_BYTES]; if (is.read(bytes) != SIZE_IN_BYTES) { throw new EOFException(); } return new UINT8(bytes); } UINT8(long value);  UINT8(BigInteger value);  UINT8(byte[] bytes); }
UINT8 extends PtpInteger { public static UINT8 read(InputStream is) throws IOException { byte[] bytes = new byte[SIZE_IN_BYTES]; if (is.read(bytes) != SIZE_IN_BYTES) { throw new EOFException(); } return new UINT8(bytes); } UINT8(long value);  UINT8(BigInteger value);  UINT8(byte[] bytes); static UINT8 read(InputStream is); }
UINT8 extends PtpInteger { public static UINT8 read(InputStream is) throws IOException { byte[] bytes = new byte[SIZE_IN_BYTES]; if (is.read(bytes) != SIZE_IN_BYTES) { throw new EOFException(); } return new UINT8(bytes); } UINT8(long value);  UINT8(BigInteger value);  UINT8(byte[] bytes); static UINT8 read(InputStream is); static final int SIZE_IN_BYTES; static final UINT8 MIN_VALUE; static final UINT8 MAX_VALUE; static final UINT8 ZERO; }