Interface: java.io.ObjectInput

  • public interface ObjectInput
  • extends DataInput
ObjectInput extends the DataInput interface to include the reading of objects. DataInput includes methods for the input of primitive types, ObjectInput extends that interface to include objects, arrays, and Strings.
Authors:
@author unascribed
See:
@see java.io.InputStream
@see java.io.ObjectOutputStream
@see java.io.ObjectInputStream
Since:
@since JDK1.1

Inheritance

Implements:

Methods

  • availabletop

    public int available() throws IOException
    Returns the number of bytes that can be read without blocking.
    Return:
    @return the number of available bytes.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow
  • closetop

    public void close() throws IOException
    Closes the input stream. Must be called to release any resources associated with the stream.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow
  • readtop

    public int read() throws IOException
    Reads a byte of data. This method will block if no input is available.
    Return:
    @return the byte read, or -1 if the end of the stream is reached.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow
  • readtop

    public int read(byte[] b) throws IOException
    Reads into an array of bytes. This method will block until some input is available.
    Parameters:
    @param b the buffer into which the data is read
    Return:
    @return the actual number of bytes read, -1 is returned when the end of the stream is reached.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow
  • readtop

    public int read(byte[] b, int off, int len) throws IOException
    Reads into an array of bytes. This method will block until some input is available.
    Parameters:
    @param b the buffer into which the data is read
    @param off the start offset of the data
    @param len the maximum number of bytes read
    Return:
    @return the actual number of bytes read, -1 is returned when the end of the stream is reached.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow
  • readObjecttop

    public Object readObject() throws ClassNotFoundException, IOException
    Read and return an object. The class that implements this interface defines where the object is "read" from.
    Return:
    @return the object read from the stream
    Exceptions:
    @exception ClassNotFoundException If the class of a serialized object cannot be found.
    @exception IOException If any of the usual Input/Output related exceptions occur.
    Google Code Search
    Stack Overflow
  • skiptop

    public long skip(long n) throws IOException
    Skips n bytes of input.
    Parameters:
    @param n the number of bytes to be skipped
    Return:
    @return the actual number of bytes skipped.
    Exceptions:
    @exception IOException If an I/O error has occurred.
    Google Code Search
    Stack Overflow