Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.io
Interface ObjectInput

All Superinterfaces:
java.io.DataInput
All Known Implementing Classes:
ObjectInputStream

public interface ObjectInput
extends java.io.DataInput

Streams to be used with serialization to read objects must implement this interface. ObjectInputStream is one example.

See Also:
ObjectInputStream, ObjectOutput

Method Summary
 int available()
          Answers a int representing then number of bytes of primitive data that are available.
 void close()
          Close this ObjectInput.
 int read()
          Reads a single byte from this ObjectInput and returns the result as an int.
 int read(byte[] buffer)
          Reads bytes from the ObjectInput and stores them in byte array buffer.
 int read(byte[] buffer, int offset, int count)
          Reads at most count bytes from the ObjectInput and stores them in byte array buffer starting at offset count.
 java.lang.Object readObject()
          Reads the next object from this ObjectInput.
 long skip(long toSkip)
          Skips toSkip number of bytes in this ObjectInput.
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Method Detail

available

int available()
              throws java.io.IOException
Answers a int representing then number of bytes of primitive data that are available.

Returns:
int the number of primitive bytes available.
Throws:
java.io.IOException - If an error occurs in this ObjectInput.

close

void close()
           throws java.io.IOException
Close this ObjectInput. Concrete implementations of this class should free any resources during close.

Throws:
java.io.IOException - If an error occurs attempting to close this ObjectInput.

read

int read()
         throws java.io.IOException
Reads a single byte from this ObjectInput and returns the result as an int. The low-order byte is returned or -1 of the end of stream was encountered.

Returns:
int The byte read or -1 if end of ObjectInput.
Throws:
java.io.IOException - If the ObjectInput is already closed or another IOException occurs.

read

int read(byte[] buffer)
         throws java.io.IOException
Reads bytes from the ObjectInput and stores them in byte array buffer. Blocks while waiting for input.

Parameters:
buffer - the array in which to store the read bytes.
Returns:
how many bytes were read or -1 if encountered end of ObjectInput.
Throws:
java.io.IOException - If the ObjectInput is already closed or another IOException occurs.

read

int read(byte[] buffer,
         int offset,
         int count)
         throws java.io.IOException
Reads at most count bytes from the ObjectInput and stores them in byte array buffer starting at offset count. Answer the number of bytes actually read or -1 if no bytes were read and end of ObjectInput was encountered.

Parameters:
buffer - the byte array in which to store the read bytes.
offset - the offset in buffer to store the read bytes.
count - the maximum number of bytes to store in buffer.
Returns:
the number of bytes actually read or -1 if end of ObjectInput.
Throws:
java.io.IOException - If the ObjectInput is already closed or another IOException occurs.

readObject

java.lang.Object readObject()
                            throws java.lang.ClassNotFoundException,
                                   java.io.IOException
Reads the next object from this ObjectInput.

Returns:
the next object read from this ObjectInput
Throws:
java.io.IOException - If an error occurs attempting to read from this ObjectInput.
java.lang.ClassNotFoundException - If the object's class cannot be found

skip

long skip(long toSkip)
          throws java.io.IOException
Skips toSkip number of bytes in this ObjectInput. Subsequent read()'s will not return these bytes.

Parameters:
toSkip - the number of bytes to skip.
Returns:
the number of bytes actually skipped.
Throws:
java.io.IOException - If the ObjectInput is already closed or another IOException occurs.

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.