java.io
Interface DataInput

All Known Implementing Classes:
DataInputStream, RandomAccessFile

public interface DataInput

DataInput is an interface describing streams that can read input in a machine-independent format.

See Also:
DataInputStream, DataOutput

Method Summary
 boolean readBoolean()
          Reads in a boolean.
 byte readByte()
          Reads an 8 bit byte.
 char readChar()
          Reads a 16 bit char.
 double readDouble()
          Reads a 64 bit double.
 float readFloat()
          Reads a 32 bit float.
 void readFully(byte[] b)
          Reads bytes, blocking until all bytes are read.
 void readFully(byte[] b, int off, int len)
          Reads bytes, blocking until all bytes are read.
 int readInt()
          Reads a 32 bit int.
 String readLine()
           
 long readLong()
          Reads a 64 bit long.
 short readShort()
          Reads a 16 bit short.
 int readUnsignedByte()
          Reads an unsigned 8 bit byte.
 int readUnsignedShort()
          Reads an unsigned 16 bit short.
 String readUTF()
           
 int skipBytes(int n)
          Skips bytes, block until all bytes are skipped.
 

Method Detail

readFully

public void readFully(byte[] b)
               throws IOException
Reads bytes, blocking until all bytes are read.

Parameters:
b - the buffer into which the data is read
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws IOException
Reads bytes, blocking until all bytes are read.

Parameters:
b - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes to read
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

skipBytes

public int skipBytes(int n)
              throws IOException
Skips bytes, block until all bytes are skipped.

Parameters:
n - the number of bytes to be skipped
Returns:
the actual number of bytes skipped.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readBoolean

public boolean readBoolean()
                    throws IOException
Reads in a boolean.

Returns:
the boolean read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readByte

public byte readByte()
              throws IOException
Reads an 8 bit byte.

Returns:
the 8 bit byte read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readUnsignedByte

public int readUnsignedByte()
                     throws IOException
Reads an unsigned 8 bit byte.

Returns:
the 8 bit byte read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readShort

public short readShort()
                throws IOException
Reads a 16 bit short.

Returns:
the 16 bit short read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readUnsignedShort

public int readUnsignedShort()
                      throws IOException
Reads an unsigned 16 bit short.

Returns:
the 16 bit short read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readChar

public char readChar()
              throws IOException
Reads a 16 bit char.

Returns:
the 16 bit char read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readInt

public int readInt()
            throws IOException
Reads a 32 bit int.

Returns:
the 32 bit integer read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readLong

public long readLong()
              throws IOException
Reads a 64 bit long.

Returns:
the read 64 bit long.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readFloat

public float readFloat()
                throws IOException
Reads a 32 bit float.

Returns:
the 32 bit float read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readDouble

public double readDouble()
                  throws IOException
Reads a 64 bit double.

Returns:
the 64 bit double read.
Throws:
EOFException - If end of file is reached.
IOException - If other I/O error has occurred.

readLine

public String readLine()
                throws IOException
IOException

readUTF

public String readUTF()
               throws IOException
IOException