public class ByteOrderInputStream extends BitInputStream implements DataInput
Modifier and Type | Field and Description |
---|---|
protected boolean |
little |
BIT_MASK, FIELD_MASK, MASK_SIZE, ONES, ZERO
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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) |
byteAlign, fetchByte, readBitFlag, readFBits, readSBits, readUBits
read, skip, startDecompressing
read
available, close, mark, markSupported, read, reset
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.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 readIOException
- if read failspublic int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public int[] readUnsignedByte(int n) throws IOException
n
- number of bytes to readIOException
- if read failspublic short readShort() throws IOException
readShort
in interface DataInput
IOException
public short[] readShort(int n) throws IOException
n
- number of shorts to readIOException
- if read failspublic int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public int[] readUnsignedShort(int n) throws IOException
n
- number of shorts to readIOException
- if read failspublic int readInt() throws IOException
readInt
in interface DataInput
IOException
public int[] readInt(int n) throws IOException
n
- number of ints to readIOException
- if read failspublic long readUnsignedInt() throws IOException
IOException
- if read failspublic long[] readUnsignedInt(int n) throws IOException
n
- number of ints to readIOException
- 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
@Deprecated 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 failsCopyright © 2016. All rights reserved.