|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.io.InputStream jcontrol.io.DataInputStream
public abstract class DataInputStream
A DataInputStream
allows to read java basic data types from an
InputStream
. Additionally, the endianess of the contained data
can be specified.
A DataInputStream can not be instantiated directly,
instead an instance must be created through the static method
createDataInputStream( InputStream in, int endianess)
.
Field Summary | |
---|---|
static int |
BIG_ENDIAN
Big endian mode. |
static int |
LITTLE_ENDIAN
Little endian mode. |
Constructor Summary | |
---|---|
DataInputStream()
|
Method Summary | |
---|---|
static DataInputStream |
createDataInputStream(InputStream in)
Creates a new DataInputStream with big endian data format. |
static DataInputStream |
createDataInputStream(InputStream in,
int endianess)
Creates a new DataInputStream. |
abstract boolean |
readBoolean()
Reads a boolean value, represented by a byte value of 0 (false)
of 1 (true), from the stream. |
abstract char |
readChar()
Reads a char value from the stream. |
abstract double |
readDouble()
Reads a double value from the stream. |
abstract float |
readFloat()
Reads a float value from the stream. |
abstract int |
readInt()
Reads an int value from the stream. |
abstract long |
readLong()
Reads a long value from the stream. |
abstract short |
readShort()
Reads a short value from the stream. |
Methods inherited from class jcontrol.io.InputStream |
---|
available, close, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
public static final int BIG_ENDIAN
public static final int LITTLE_ENDIAN
Constructor Detail |
---|
public DataInputStream()
Method Detail |
---|
public static DataInputStream createDataInputStream(InputStream in, int endianess)
in
- InputStream to useendianess
- BIG_ENDIAN
or LITTLE_ENDIAN
public static DataInputStream createDataInputStream(InputStream in)
in
- InputStream to use
public abstract boolean readBoolean() throws IOException
boolean
value, represented by a byte value of 0
(false)
of 1
(true), from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract char readChar() throws IOException
char
value from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract short readShort() throws IOException
short
value from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract int readInt() throws IOException
int
value from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract long readLong() throws IOException
long
value from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract float readFloat() throws IOException
float
value from the stream.
IOException
- occurs on I/O error or when the stream is closedpublic abstract double readDouble() throws IOException
double
value from the stream.
IOException
- occurs on I/O error or when the stream is closed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |