DataInputStream

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
readBoolean()
Reads a boolean.
final byte
readByte()
Reads an 8-bit byte value.
final char
readChar()
Reads a big-endian 16-bit character value.
final double
readDouble()
Reads a big-endian 64-bit double value.
final float
readFloat()
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
readInt()
Reads a big-endian 32-bit integer value.
final String
readLine()
This method was deprecated. This method cannot be trusted to convert bytes to characters correctly. Wrap this stream with a BufferedReader instead.
final long
readLong()
Reads a big-endian 64-bit long value.
final short
readShort()
Reads a big-endian 16-bit short value.
final String
readUTF()
Reads a string encoded with modified UTF-8.
final static String
final int
readUnsignedByte()
Reads an unsigned 8-bit byte value and returns it as an int.
final int
readUnsignedShort()
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