Modifier and Type | Field and Description |
---|---|
protected DataInputStream |
dis
to get at the big-Endian methods of a basic DataInputStream
|
protected InputStream |
is
to get at the a basic readBytes method.
|
protected byte[] |
work
work array for buffering input.
|
Constructor and Description |
---|
LEDataInputStream(InputStream in)
constructor.
|
LEDataInputStream(String filename) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close.
|
int |
read(byte[] ba,
int off,
int len)
Read bytes.
|
boolean |
readBoolean()
read only a one-byte boolean.
|
boolean[] |
readBoolean(int len) |
byte |
readByte()
read byte.
|
byte[] |
readByte(int len) |
char |
readChar()
Read on char.
|
char[] |
readChar(int len) |
double |
readDouble()
Read a double.
|
double[] |
readDouble(int len) |
int[] |
readDoubleToInt(int len) |
float |
readFloat()
Read one float.
|
float[] |
readFloat(int len) |
void |
readFully(byte[] ba)
Read bytes until the array is filled.
|
void |
readFully(byte[] ba,
int off,
int len)
Read bytes until the count is satisfied.
|
int |
readInt()
Read an int, 32-bits.
|
int[] |
readInt(int len) |
String |
readLine()
Deprecated.
This method does not properly convert bytes to characters. Use a Reader instead with a little-endian encoding.
|
long |
readLong()
read a long, 64-bits.
|
long[] |
readLong(int len) |
short |
readShort()
Read short, 16-bits.
|
short[] |
readShort(int len) |
int |
readUnsignedByte()
Read an unsigned byte.
|
int[] |
readUnsignedByte(int len) |
int |
readUnsignedShort()
Read an unsigned short, 16 bits.
|
int[] |
readUnsignedShort(int len) |
String |
readUTF()
Read UTF counted string.
|
static String |
readUTF(DataInput in)
Note.
|
int |
skipBytes(int n)
Skip over bytes in the stream.
|
protected final DataInputStream dis
protected final InputStream is
protected final byte[] work
public LEDataInputStream(InputStream in)
in
- binary inputstream of little-endian data.public LEDataInputStream(String filename) throws FileNotFoundException
FileNotFoundException
public static String readUTF(DataInput in) throws IOException
in
- stream to read UTF chars from (endian irrelevant)IOException
- if read fails.public final void close() throws IOException
IOException
- if close fails.public final int read(byte[] ba, int off, int len) throws IOException
ba
- where the bytes go.off
- offset in buffer, not offset in file.len
- count of bytes to read.IOException
- if read fails.public final boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
- if read fails.DataInput.readBoolean()
public final boolean[] readBoolean(int len) throws IOException
IOException
public final byte readByte() throws IOException
readByte
in interface DataInput
IOException
- if read fails.DataInput.readByte()
public final byte[] readByte(int len) throws IOException
IOException
public final char readChar() throws IOException
readChar
in interface DataInput
IOException
- if read fails.public final char[] readChar(int len) throws IOException
IOException
public final double readDouble() throws IOException
readDouble
in interface DataInput
IOException
- IOExceptionpublic final double[] readDouble(int len) throws IOException
IOException
public final int[] readDoubleToInt(int len) throws IOException
IOException
public final float readFloat() throws IOException
readFloat
in interface DataInput
IOException
- if read fails.public final float[] readFloat(int len) throws IOException
IOException
public final void readFully(byte[] ba) throws IOException
readFully
in interface DataInput
IOException
DataInput.readFully(byte[])
public final void readFully(byte[] ba, int off, int len) throws IOException
readFully
in interface DataInput
IOException
- if read fails.DataInput.readFully(byte[],int,int)
public final int readInt() throws IOException
readInt
in interface DataInput
IOException
- if read fails.public final int[] readInt(int len) throws IOException
IOException
public final String readLine() throws IOException
readLine
in interface DataInput
IOException
- IOExceptionpublic final long readLong() throws IOException
readLong
in interface DataInput
IOException
- IOExceptionpublic final long[] readLong(int len) throws IOException
IOException
public final short readShort() throws IOException
readShort
in interface DataInput
IOException
- if read fails.public final short[] readShort(int len) throws IOException
IOException
public final String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public final int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
- if read fails.DataInput.readUnsignedByte()
public final int[] readUnsignedByte(int len) throws IOException
IOException
public final int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
- if read fails.public final int[] readUnsignedShort(int len) throws IOException
IOException
public final int skipBytes(int n) throws IOException
Skip over bytes in the stream. See the general contract of the skipBytes
method of DataInput
.
skipBytes
in interface DataInput
n
- the number of bytes to be skipped.IOException
- if an I/O error occurs.Copyright © 2000–2016 DFKI GmbH. All rights reserved.