public class DataInputStream extends FilterInputStream
implements DataInput

Wraps an existing InputStream and reads big-endian typed data from it. Typically, this stream has been written by a DataOutputStream. Types that can be read include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and strings encoded in modified UTF-8.

See Also

Inherited Field Summary

Public Constructor Summary

DataInputStream(InputStream in)
Constructs a new DataInputStream on the InputStream in.

Public Method Summary

final int
read(byte[] buffer)
Reads up to byte.length bytes of data from this input stream into an array of bytes.
final int
read(byte[] buffer, int byteOffset, int byteCount)
Reads up to len bytes of data from this input stream into an array of bytes.
final boolean
Reads a boolean.
final byte
Reads an 8-bit byte value.
final char
Reads a big-endian 16-bit character value.
final double
Reads a big-endian 64-bit double value.
final float
Reads a big-endian 32-bit float value.
final void
readFully(byte[] dst)
Equivalent to readFully(dst, 0, dst.length);.
final void
readFully(byte[] dst, int offset, int byteCount)
Reads byteCount bytes from this stream and stores them in the byte array dst starting at offset.
final int
Reads a big-endian 32-bit integer value.
final String
This method was deprecated. This method cannot be trusted to convert bytes to characters correctly. Wrap this stream with a BufferedReader instead.
final long
Reads a big-endian 64-bit long value.
final short
Reads a big-endian 16-bit short value.
final String
Reads a string encoded with modified UTF-8.
final static String
final int
Reads an unsigned 8-bit byte value and returns it as an int.
final int
Reads a big-endian 16-bit unsigned short value and returns it as an int.
final int
skipBytes(int count)
Skips count number of bytes in this stream.

Inherited Method Summary