public class DataInput
extends java.lang.Object
| Constructor and Description |
|---|
DataInput(java.io.InputStream in)
Create a DataInput class instance using by native order.
|
DataInput(java.io.InputStream in,
java.nio.ByteOrder endian)
Create a DataInput class instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getCount() |
int |
readByte()
Reads the next one byte of this input stream as a signed 8-bit integer.
|
byte[] |
readBytes(int n) |
int |
readInt16()
Reads the next two bytes of this input stream as a signed 16-bit integer.
|
int |
readInt32()
Reads the next four bytes of this input stream as a signed 32-bit integer.
|
int |
readUint16()
Reads the next two bytes of this input stream as a unsigned 16-bit integer.
|
long |
readUint32()
Reads the next four bytes of this input stream as a unsigned 32-bit integer.
|
void |
setCount(int count) |
public DataInput(java.io.InputStream in)
in - the input stream that had better buffer by a BufferedInputStream.public DataInput(java.io.InputStream in,
java.nio.ByteOrder endian)
in - the input stream that had better buffer by a BufferedInputStream.endian - the endian of the input streampublic int readByte()
throws java.io.IOException,
java.io.EOFException
int value as a signed 8-bit integer.java.io.IOException - if an I/O error occurs.java.io.EOFException - if this stream reaches the end before reading all the bytes.public int readInt16()
throws java.io.IOException,
java.io.EOFException
int value as a signed 16-bit integer.java.io.IOException - if an I/O error occurs.java.io.EOFException - if this stream reaches the end before reading all the bytes.public int readInt32()
throws java.io.IOException,
java.io.EOFException
int value as a signed 32-bit integer.java.io.IOException - if an I/O error occurs.java.io.EOFException - if this stream reaches the end before reading all the bytes.public int readUint16()
throws java.io.IOException,
java.io.EOFException
int value as a unsigned 16-bit integer.java.io.IOException - if an I/O error occurs.java.io.EOFException - if this stream reaches the end before reading all the bytes.public long readUint32()
throws java.io.IOException,
java.io.EOFException
long value as a unsigned 32-bit integer.java.io.IOException - if an I/O error occurs.java.io.EOFException - if this stream reaches the end before reading all the bytes.public byte[] readBytes(int n)
throws java.io.IOException,
java.io.EOFException
java.io.IOExceptionjava.io.EOFExceptionpublic void setCount(int count)
public int getCount()
public void close()