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