|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream org.freehep.util.io.DecompressableInputStream org.freehep.util.io.BitInputStream org.freehep.util.io.ByteOrderInputStream
public class ByteOrderInputStream
Class to read bytes and pairs of bytes in both little and big endian order.
Field Summary | |
---|---|
protected boolean |
little
|
Fields inherited from class org.freehep.util.io.BitInputStream |
---|
BIT_MASK, FIELD_MASK, MASK_SIZE, ONES, ZERO |
Constructor Summary | |
---|---|
ByteOrderInputStream(InputStream in)
Create a byte order (big-endian) input stream from given stream. |
|
ByteOrderInputStream(InputStream in,
boolean littleEndian)
Create a byte order input stream from given stream. |
Method Summary | |
---|---|
String |
readAsciiZString()
Read an ascii-z (0 terminated c-string). |
boolean |
readBoolean()
|
byte |
readByte()
Read a signed byte. |
byte[] |
readByte(int n)
Read n bytes and return in byte array. |
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
Read a signed integer. |
int[] |
readInt(int n)
Read n ints and return in int array. |
String |
readLine()
Deprecated. |
long |
readLong()
|
short |
readShort()
Read a signed short. |
short[] |
readShort(int n)
Read n shorts and return in short array |
String |
readString()
Read a string (UTF). |
int |
readUnsignedByte()
Read an unsigned byte. |
int[] |
readUnsignedByte(int n)
Read n unsigned bytes and return in int array. |
long |
readUnsignedInt()
Read an unsigned integer. |
long[] |
readUnsignedInt(int n)
Read n unsigned ints and return in long array. |
int |
readUnsignedShort()
Read an unsigned short. |
int[] |
readUnsignedShort(int n)
Read n unsigned shorts and return in int array |
String |
readUTF()
|
int |
skipBytes(int n)
|
Methods inherited from class org.freehep.util.io.BitInputStream |
---|
byteAlign, fetchByte, readBitFlag, readFBits, readSBits, readUBits |
Methods inherited from class org.freehep.util.io.DecompressableInputStream |
---|
read, skip, startDecompressing |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean little
Constructor Detail |
---|
public ByteOrderInputStream(InputStream in)
in
- stream to read frompublic ByteOrderInputStream(InputStream in, boolean littleEndian)
in
- stream to read fromlittleEndian
- true if stream should be little endian.Method Detail |
---|
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public char readChar() throws IOException
readChar
in interface DataInput
IOException
public byte readByte() throws IOException
readByte
in interface DataInput
IOException
public byte[] readByte(int n) throws IOException
n
- number of bytes to read
IOException
- if read failspublic int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public int[] readUnsignedByte(int n) throws IOException
n
- number of bytes to read
IOException
- if read failspublic short readShort() throws IOException
readShort
in interface DataInput
IOException
public short[] readShort(int n) throws IOException
n
- number of shorts to read
IOException
- if read failspublic int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public int[] readUnsignedShort(int n) throws IOException
n
- number of shorts to read
IOException
- if read failspublic int readInt() throws IOException
readInt
in interface DataInput
IOException
public int[] readInt(int n) throws IOException
n
- number of ints to read
IOException
- if read failspublic long readUnsignedInt() throws IOException
IOException
- if read failspublic long[] readUnsignedInt(int n) throws IOException
n
- number of ints to read
IOException
- if read failspublic long readLong() throws IOException
readLong
in interface DataInput
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public String readLine() throws IOException
readLine
in interface DataInput
IOException
public String readString() throws IOException
IOException
- if read failspublic String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public String readAsciiZString() throws IOException
IOException
- if read fails
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |