@Override public byte readByte() { checkPosition(1); return (byte)read(); }
@Override public void readFully(byte[] buffer, int off, int len) { checkPosition(len); read(buffer, off, len); }
@Override public void readFully(byte[] buffer) { checkPosition(buffer.length); read(buffer, 0, buffer.length); }
@Override public int readInt() { final int size = LittleEndianConsts.INT_SIZE; checkPosition(size); int le = LittleEndian.getInt(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
@Override public long readLong() { final int size = LittleEndianConsts.LONG_SIZE; checkPosition(size); long le = LittleEndian.getLong(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
@Override public short readShort() { final int size = LittleEndianConsts.SHORT_SIZE; checkPosition(size); short le = LittleEndian.getShort(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
public int readUShort() { checkPosition(2); int i = _readIndex; int b0 = _buf[i++] & 0xFF; int b1 = _buf[i++] & 0xFF; _readIndex = i; return (b1 << 8) + (b0 << 0); } public void readFully(byte[] buf, int off, int len) {
public byte readByte() { checkPosition(1); return _buf[_readIndex++]; }
public int readInt() { checkPosition(4); int i = _readIndex; int b0 = _buf[i++] & 0xFF; int b1 = _buf[i++] & 0xFF; int b2 = _buf[i++] & 0xFF; int b3 = _buf[i++] & 0xFF; _readIndex = i; return (b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0); } public long readLong() {
public int readUShort() { checkPosition(2); int i = _readIndex; int b0 = _buf[i++] & 0xFF; int b1 = _buf[i++] & 0xFF; _readIndex = i; return (b1 << 8) + (b0 << 0); } public void readFully(byte[] buf, int off, int len) {
public int readInt() { checkPosition(4); int i = _readIndex; int b0 = _buf[i++] & 0xFF; int b1 = _buf[i++] & 0xFF; int b2 = _buf[i++] & 0xFF; int b3 = _buf[i++] & 0xFF; _readIndex = i; return (b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0); } public long readLong() {
public int readUByte() { checkPosition(1); return _buf[_readIndex++] & 0xFF; } public int readUShort() {
public int readUByte() { checkPosition(1); return _buf[_readIndex++] & 0xFF; } public int readUShort() {
public void readFully(byte[] buf, int off, int len) { checkPosition(len); System.arraycopy(_buf, _readIndex, buf, off, len); _readIndex+=len; } public void readFully(byte[] buf) {
@Override public byte readByte() { checkPosition(1); return (byte)read(); }
@Override public void readFully(byte[] buffer, int off, int len) { checkPosition(len); read(buffer, off, len); }
@Override public void readFully(byte[] buffer) { checkPosition(buffer.length); read(buffer, 0, buffer.length); }
@Override public int readInt() { final int size = LittleEndianConsts.INT_SIZE; checkPosition(size); int le = LittleEndian.getInt(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
@Override public short readShort() { final int size = LittleEndianConsts.SHORT_SIZE; checkPosition(size); short le = LittleEndian.getShort(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
@Override public long readLong() { final int size = LittleEndianConsts.LONG_SIZE; checkPosition(size); long le = LittleEndian.getLong(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }