Methods Summary |
---|
public java.nio.ByteOrder | getByteOrder()
return mByteBuffer.order();
|
public int | getReadByteCount()
return mCount;
|
public int | read(byte[] b)
int r = in.read(b);
mCount += (r >= 0) ? r : 0;
return r;
|
public int | read(byte[] b, int off, int len)
int r = in.read(b, off, len);
mCount += (r >= 0) ? r : 0;
return r;
|
public int | read()
int r = in.read();
mCount += (r >= 0) ? 1 : 0;
return r;
|
public int | readInt()
readOrThrow(mByteArray, 0 , 4);
mByteBuffer.rewind();
return mByteBuffer.getInt();
|
public long | readLong()
readOrThrow(mByteArray, 0 , 8);
mByteBuffer.rewind();
return mByteBuffer.getLong();
|
public void | readOrThrow(byte[] b)
readOrThrow(b, 0, b.length);
|
public void | readOrThrow(byte[] b, int off, int len)
int r = read(b, off, len);
if (r != len) throw new EOFException();
|
public short | readShort()
readOrThrow(mByteArray, 0 ,2);
mByteBuffer.rewind();
return mByteBuffer.getShort();
|
public java.lang.String | readString(int n)
byte buf[] = new byte[n];
readOrThrow(buf);
return new String(buf, "UTF8");
|
public java.lang.String | readString(int n, java.nio.charset.Charset charset)
byte buf[] = new byte[n];
readOrThrow(buf);
return new String(buf, charset);
|
public long | readUnsignedInt()
return readInt() & 0xffffffffL;
|
public int | readUnsignedShort()
return readShort() & 0xffff;
|
public void | setByteOrder(java.nio.ByteOrder order)
mByteBuffer.order(order);
|
public long | skip(long length)
long skip = in.skip(length);
mCount += skip;
return skip;
|
public void | skipOrThrow(long length)
if (skip(length) != length) throw new EOFException();
|
public void | skipTo(long target)
long cur = mCount;
long diff = target - cur;
assert(diff >= 0);
skipOrThrow(diff);
|