All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.io.DataInput

public interface DataInput
The data input interface is implemented by streams that can read primitive Java data types from a stream in a machine-independent manner.

See Also:
DataInputStream, DataOutput

Method Index

 o readBoolean()
Reads a boolean value from the input stream.
 o readByte()
Reads a signed 8-bit value from the input stream.
 o readChar()
Reads a Unicode char value from the input stream.
 o readDouble()
Reads a double value from the input stream.
 o readFloat()
Reads a float value from the input stream.
 o readFully(byte[])
Reads b.length bytes into the byte array.
 o readFully(byte[], int, int)
Reads b.length bytes into the byte array.
 o readInt()
Reads an int value from the input stream.
 o readLine()
Reads the next line of text from the input stream.
 o readLong()
Reads a long value from the input stream.
 o readShort()
Reads a 16-bit value from the input stream.
 o readUnsignedByte()
Reads an unsigned 8-bit value from the input stream.
 o readUnsignedShort()
Reads an unsigned 16-bit value from the input stream.
 o readUTF()
Reads in a string that has been encoded using a modified UTF-8 format.
 o skipBytes(int)
Skips exactly n bytes of input.

Methods

 o readFully
    method readFully(b=byte[])  public abstract    Signals IOException
Reads b.length bytes into the byte array. This method blocks until all the bytes are read.

Parameters:
b - the buffer into which the data is read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readFully
    method readFully(b=byte[], -
                     off=int, -
                     len=int)  public abstract    Signals IOException
Reads b.length bytes into the byte array. This method blocks until all the bytes are read.

Parameters:
b - the buffer into which the data is read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o skipBytes
    method skipBytes(n=int) returns int public abstract    Signals IOException
Skips exactly n bytes of input.

Parameters:
n - the number of bytes to be skipped.
Returns:
the number of bytes skipped, which is always n.
Throws: EOFException
if this stream reaches the end before skipping all the bytes.
Throws: IOException
if an I/O error occurs.
 o readBoolean
    method readBoolean() returns boolean public abstract    Signals IOException
Reads a boolean value from the input stream.

Returns:
the boolean value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readByte
    method readByte() returns byte public abstract    Signals IOException
Reads a signed 8-bit value from the input stream.

Returns:
the 8-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readUnsignedByte
    method readUnsignedByte() returns int public abstract    Signals IOException
Reads an unsigned 8-bit value from the input stream.

Returns:
the unsigned 8-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readShort
    method readShort() returns short public abstract    Signals IOException
Reads a 16-bit value from the input stream.

Returns:
the 16-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readUnsignedShort
    method readUnsignedShort() returns int public abstract    Signals IOException
Reads an unsigned 16-bit value from the input stream.

Returns:
the unsigned 16-bit value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readChar
    method readChar() returns char public abstract    Signals IOException
Reads a Unicode char value from the input stream.

Returns:
the Unicode char read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readInt
    method readInt() returns int public abstract    Signals IOException
Reads an int value from the input stream.

Returns:
the int value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readLong
    method readLong() returns long public abstract    Signals IOException
Reads a long value from the input stream.

Returns:
the long value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readFloat
    method readFloat() returns float public abstract    Signals IOException
Reads a float value from the input stream.

Returns:
the float value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readDouble
    method readDouble() returns double public abstract    Signals IOException
Reads a double value from the input stream.

Returns:
the double value read.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readLine
    method readLine() returns String public abstract    Signals IOException
Reads the next line of text from the input stream.

Returns:
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
 o readUTF
    method readUTF() returns String public abstract    Signals IOException
Reads in a string that has been encoded using a modified UTF-8 format.

For an exact description of this method, see the discussion in Gosling, Joy, and Steele, The Java Language Specification.

Returns:
a Unicode string.
Throws: EOFException
if this stream reaches the end before reading all the bytes.
Throws: IOException
if an I/O error occurs.
Throws: UTFDataFormatException
if the bytes do not represent a valid UTF-8 encoding of a string.

All Packages  Class Hierarchy  This Package  Previous  Next  Index