@Test public void testReadUnsignedInt() throws IOException { BinaryReader br = br(true, 1, 0, 0, 0, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0x80); assertEquals(1, br.readUnsignedInt(0)); assertEquals(Integer.MAX_VALUE, br.readUnsignedInt(4)); assertEquals(NumberUtil.UNSIGNED_INT_MASK , br.readUnsignedInt(8)); assertEquals((long) Integer.MAX_VALUE + 1 , br.readUnsignedInt(12)); try { br.readUnsignedInt(16); fail("Should have triggered IOException"); } catch (IOException ioe) { } }
public long readUnsignedInt(long index) throws IOException { return readInt(index) & NumberUtil.UNSIGNED_INT_MASK; }
BinaryReader { public long readUnsignedInt(long index) throws IOException { return readInt(index) & NumberUtil.UNSIGNED_INT_MASK; } }
BinaryReader { public long readUnsignedInt(long index) throws IOException { return readInt(index) & NumberUtil.UNSIGNED_INT_MASK; } BinaryReader(ByteProvider provider, boolean isLittleEndian); }
BinaryReader { public long readUnsignedInt(long index) throws IOException { return readInt(index) & NumberUtil.UNSIGNED_INT_MASK; } BinaryReader(ByteProvider provider, boolean isLittleEndian); BinaryReader clone(int newIndex); boolean isLittleEndian(); void setLittleEndian(boolean isLittleEndian); long length(); boolean isValidIndex(int index); boolean isValidIndex(long index); int align(int alignValue); void setPointerIndex(int index); void setPointerIndex(long index); long getPointerIndex(); byte peekNextByte(); short peekNextShort(); int peekNextInt(); long peekNextLong(); byte readNextByte(); int readNextUnsignedByte(); short readNextShort(); int readNextUnsignedShort(); int readNextInt(); long readNextUnsignedInt(); long readNextLong(); String readNextAsciiString(); String readNextNullTerminatedAsciiString(); String readNextAsciiString(int length); String readNextUnicodeString(); String readNextUnicodeString(int length); byte[] readNextByteArray(int nElements); short[] readNextShortArray(int nElements); int[] readNextIntArray(int nElements); long[] readNextLongArray(int nElements); String readAsciiString(long index); String readAsciiString(long index, int length); String readTerminatedString(long index, char termChar); String readTerminatedString(long index, String termChars); String readFixedLenAsciiString(long index, int len); String readUnicodeString(long index); String readUnicodeString(long index, int length); byte readByte(long index); int readUnsignedByte(long index); short readShort(long index); int readUnsignedShort(long index); int readInt(long index); long readUnsignedInt(long index); int readInt(long index, int minClamp, int maxClamp); long readLong(long index); byte[] readByteArray(long index, int nElements); short[] readShortArray(long index, int nElements); int[] readIntArray(long index, int nElements); long[] readLongArray(long index, int nElements); String[] readAsciiStringArray(long index, int nElements); ByteProvider getByteProvider(); }
BinaryReader { public long readUnsignedInt(long index) throws IOException { return readInt(index) & NumberUtil.UNSIGNED_INT_MASK; } BinaryReader(ByteProvider provider, boolean isLittleEndian); BinaryReader clone(int newIndex); boolean isLittleEndian(); void setLittleEndian(boolean isLittleEndian); long length(); boolean isValidIndex(int index); boolean isValidIndex(long index); int align(int alignValue); void setPointerIndex(int index); void setPointerIndex(long index); long getPointerIndex(); byte peekNextByte(); short peekNextShort(); int peekNextInt(); long peekNextLong(); byte readNextByte(); int readNextUnsignedByte(); short readNextShort(); int readNextUnsignedShort(); int readNextInt(); long readNextUnsignedInt(); long readNextLong(); String readNextAsciiString(); String readNextNullTerminatedAsciiString(); String readNextAsciiString(int length); String readNextUnicodeString(); String readNextUnicodeString(int length); byte[] readNextByteArray(int nElements); short[] readNextShortArray(int nElements); int[] readNextIntArray(int nElements); long[] readNextLongArray(int nElements); String readAsciiString(long index); String readAsciiString(long index, int length); String readTerminatedString(long index, char termChar); String readTerminatedString(long index, String termChars); String readFixedLenAsciiString(long index, int len); String readUnicodeString(long index); String readUnicodeString(long index, int length); byte readByte(long index); int readUnsignedByte(long index); short readShort(long index); int readUnsignedShort(long index); int readInt(long index); long readUnsignedInt(long index); int readInt(long index, int minClamp, int maxClamp); long readLong(long index); byte[] readByteArray(long index, int nElements); short[] readShortArray(long index, int nElements); int[] readIntArray(long index, int nElements); long[] readLongArray(long index, int nElements); String[] readAsciiStringArray(long index, int nElements); ByteProvider getByteProvider(); final static int SIZEOF_BYTE; final static int SIZEOF_SHORT; final static int SIZEOF_INT; final static int SIZEOF_LONG; }