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

E17503-02

oracle.adfnmc.java.io
Class ObjectInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by oracle.adfnmc.java.io.ObjectInputStream
All Implemented Interfaces:
java.io.DataInput, ObjectInput, ObjectStreamConstants

public class ObjectInputStream
extends java.io.InputStream
implements ObjectStreamConstants, ObjectInput


Field Summary
static java.lang.Class CLASS_INSTANCE
           
 
Fields inherited from interface oracle.adfnmc.java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
ObjectInputStream(java.io.InputStream input)
           
 
Method Summary
 void defaultReadObject()
          Default method to read objects from the receiver.
protected  boolean enableResolveObject(boolean enable)
           
 int read()
          Reads a single byte from the receiver and returns the result as an int.
 int read(byte[] buffer, int offset, int length)
          Reads at most length bytes from the receiver and stores them in byte array buffer starting at offset offset.
 boolean readBoolean()
          Reads and returns primitive data of type boolean read from the receiver
 byte readByte()
          Reads and returns primitive data of type byte read from the receiver
 char readChar()
          Reads and returns primitive data of type char read from the receiver
 double readDouble()
          Reads and returns primitive data of type double read from the receiver
 float readFloat()
          Reads and returns primitive data of type float read from the receiver
 void readFully(byte[] buffer)
          Reads bytes from the receiver into the byte array buffer.
 void readFully(byte[] buffer, int offset, int length)
          Reads bytes from the receiver into the byte array buffer.
 int readInt()
          Reads and returns primitive data of type int read from the receiver
 long readLong()
          Reads and returns primitive data of type long read from the receiver
 java.lang.Object readObject()
          Reads the next object from this ObjectInput.
 short readShort()
          Reads and returns primitive data of type short from the receiver
 int readUnsignedByte()
          Reads and returns primitive data of type byte (unsigned) from the receiver
 int readUnsignedShort()
          Reads and returns primitive data of type short (unsigned) from the receiver
 java.lang.String readUTF()
          Reads and returns primitive data of type String read in UTF format from the receiver
protected  java.lang.Class resolveClass(ObjectStreamClass osClass)
           
 int skipBytes(int length)
          Skips length bytes of primitive data from the receiver.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.adfnmc.java.io.ObjectInput
available, close, read, skip
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE
Constructor Detail

ObjectInputStream

public ObjectInputStream(java.io.InputStream input)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

read

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

Specified by:
read in interface ObjectInput
Specified by:
read in class java.io.InputStream
Returns:
The byte read or -1 if end of stream.
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

read

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

Specified by:
read in interface ObjectInput
Overrides:
read in class java.io.InputStream
Parameters:
buffer - the byte array in which to store the read bytes.
offset - the offset in buffer to store the read bytes.
length - the maximum number of bytes to store in buffer.
Returns:
The number of bytes actually read or -1 if end of stream.
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Reads and returns primitive data of type boolean read from the receiver

Specified by:
readBoolean in interface java.io.DataInput
Returns:
A boolean saved as primitive data using ObjectOutputStream.writeBoolean()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readByte

public byte readByte()
              throws java.io.IOException
Reads and returns primitive data of type byte read from the receiver

Specified by:
readByte in interface java.io.DataInput
Returns:
A byte saved as primitive data using ObjectOutputStream.writeByte()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readChar

public char readChar()
              throws java.io.IOException
Reads and returns primitive data of type char read from the receiver

Specified by:
readChar in interface java.io.DataInput
Returns:
A char saved as primitive data using ObjectOutputStream.writeChar()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readDouble

public double readDouble()
                  throws java.io.IOException
Reads and returns primitive data of type double read from the receiver

Specified by:
readDouble in interface java.io.DataInput
Returns:
A double saved as primitive data using ObjectOutputStream.writeDouble()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readFloat

public float readFloat()
                throws java.io.IOException
Reads and returns primitive data of type float read from the receiver

Specified by:
readFloat in interface java.io.DataInput
Returns:
A float saved as primitive data using ObjectOutputStream.writeFloat()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readFully

public void readFully(byte[] buffer)
               throws java.io.IOException
Reads bytes from the receiver into the byte array buffer. This method will block until buffer.length number of bytes have been read.

Specified by:
readFully in interface java.io.DataInput
Parameters:
buffer - the buffer to read bytes into
Throws:
java.io.IOException - if a problem occurs reading from this stream.

readFully

public void readFully(byte[] buffer,
                      int offset,
                      int length)
               throws java.io.IOException
Reads bytes from the receiver into the byte array buffer. This method will block until length number of bytes have been read.

Specified by:
readFully in interface java.io.DataInput
Parameters:
buffer - the byte array in which to store the read bytes.
offset - the offset in buffer to store the read bytes.
length - the maximum number of bytes to store in buffer.
Throws:
java.io.IOException - if a problem occurs reading from this stream.

readInt

public int readInt()
            throws java.io.IOException
Reads and returns primitive data of type int read from the receiver

Specified by:
readInt in interface java.io.DataInput
Returns:
an int saved as primitive data using ObjectOutputStream.writeInt()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readLong

public long readLong()
              throws java.io.IOException
Reads and returns primitive data of type long read from the receiver

Specified by:
readLong in interface java.io.DataInput
Returns:
a long saved as primitive data using ObjectOutputStream.writeLong()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readObject

public final java.lang.Object readObject()
Description copied from interface: ObjectInput
Reads the next object from this ObjectInput.

Specified by:
readObject in interface ObjectInput
Returns:
the next object read from this ObjectInput

resolveClass

protected java.lang.Class resolveClass(ObjectStreamClass osClass)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Reads and returns primitive data of type String read in UTF format from the receiver

Specified by:
readUTF in interface java.io.DataInput
Returns:
a String saved as primitive data using ObjectOutputStream.writeUTF()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

defaultReadObject

public void defaultReadObject()
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException
Default method to read objects from the receiver. Fields defined in the object's class and super classes (which are Serializable) will be read.

Throws:
java.io.IOException - If an IO error occurs attempting to read the object data
java.lang.ClassNotFoundException - If the class of the object cannot be found
NotActiveException - If this method is not called from readObject()
See Also:
ObjectOutputStream.defaultWriteObject()

enableResolveObject

protected boolean enableResolveObject(boolean enable)

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException
Reads and returns primitive data of type short (unsigned) from the receiver

Specified by:
readUnsignedShort in interface java.io.DataInput
Returns:
a short saved as primitive data using ObjectOutputStream.writeUnsignedShort()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readShort

public short readShort()
                throws java.io.IOException
Reads and returns primitive data of type short from the receiver

Specified by:
readShort in interface java.io.DataInput
Returns:
a short saved as primitive data using ObjectOutputStream.writeShort()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Reads and returns primitive data of type byte (unsigned) from the receiver

Specified by:
readUnsignedByte in interface java.io.DataInput
Returns:
a byte saved as primitive data using ObjectOutputStream.writeUnsignedByte()
Throws:
java.io.IOException - If an IO exception happened when reading the primitive data.

skipBytes

public int skipBytes(int length)
              throws java.io.IOException
Skips length bytes of primitive data from the receiver. It should not be used to skip bytes at any arbitrary position; just when reading primitive data types (ints, chars, etc).

Specified by:
skipBytes in interface java.io.DataInput
Parameters:
length - How many bytes to skip
Returns:
number of bytes skipped
Throws:
java.io.IOException - If any IO problem occurred when trying to skip the bytes.

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.