Methods Summary |
---|
public abstract int | available()
|
public int | read(byte[] b, int off, int len)
int read_b;
int i = 0;
do {
if ((read_b = read()) == -1) {
return (i == 0) ? -1 : i;
}
b[off+i] = (byte) read_b;
i++;
} while ((available() != 0) && (i<len));
return i;
|
public abstract int | read()Reads the following byte value. Note that in the case of
reaching of the end of the data this methods throws the
exception, not return -1. The type of exception depends
on implementation. It was done for simplifying and speeding
up of processing of such cases.
|
public byte[] | read(int length)Returns the vector of opaque values of specified length;
byte[] res = new byte[length];
for (int i=0; i<length; i++) {
res[i] = (byte) read();
}
return res;
|
public int | readUint16()Reads and returns uint16 value.
return (read() << 8) | (read() & 0x00FF);
|
public int | readUint24()Reads and returns uint24 value.
return (read() << 16) | (read() << 8) | (read() & 0x00FF);
|
public long | readUint32()Reads and returns uint32 value.
return (read() << 24) | (read() << 16)
| (read() << 8) | (read() & 0x00FF);
|
public long | readUint64()Reads and returns uint64 value.
return (read() << 56) | (read() << 48)
| (read() << 40) | (read() << 32)
| (read() << 24) | (read() << 16)
| (read() << 8) | (read() & 0x00FF);
|
public int | readUint8()Reads and returns uint8 value.
return read() & 0x00FF;
|
public long | skip(long n)
long skept = n;
while (n > 0) {
read();
n--;
}
return skept;
|