ParsableByteArray { public int readInt() { return (data[position++] & 0xFF) << 24 | (data[position++] & 0xFF) << 16 | (data[position++] & 0xFF) << 8 | (data[position++] & 0xFF); } ParsableByteArray();  ParsableByteArray(int limit);  ParsableByteArray(byte[] data);  ParsableByteArray(byte[] data, int limit); void reset(); void reset(int limit); void reset(byte[] data); void reset(byte[] data, int limit); int bytesLeft(); int limit(); void setLimit(int limit); int getPosition(); int capacity(); void setPosition(int position); void skipBytes(int bytes); void readBytes(ParsableBitArray bitArray, int length); void readBytes(byte[] buffer, int offset, int length); void readBytes(ByteBuffer buffer, int length); int peekUnsignedByte(); char peekChar(); int readUnsignedByte(); int readUnsignedShort(); int readLittleEndianUnsignedShort(); short readShort(); short readLittleEndianShort(); int readUnsignedInt24(); int readInt24(); int readLittleEndianInt24(); int readLittleEndianUnsignedInt24(); long readUnsignedInt(); long readLittleEndianUnsignedInt(); int readInt(); int readLittleEndianInt(); long readLong(); long readLittleEndianLong(); int readUnsignedFixedPoint1616(); int readSynchSafeInt(); int readUnsignedIntToInt(); int readLittleEndianUnsignedIntToInt(); long readUnsignedLongToLong(); float readFloat(); double readDouble(); String readString(int length); String readString(int length, Charset charset); String readNullTerminatedString(int length); @Nullable String readNullTerminatedString(); @Nullable String readLine(); long readUtf8EncodedLong(); public byte[] data; }
@Test public void testReadInt() { testReadInt(0); testReadInt(1); testReadInt(-1); testReadInt(Integer.MIN_VALUE); testReadInt(Integer.MAX_VALUE); }