| |
|
| java.lang.Object java.io.InputStream java.io.ObjectInputStream
Inner Class :static class InputValidationDesc | |
Inner Class :abstract public static class GetField | |
Method Summary | |
public int | available() Returns the number of bytes of primitive data available from the
receiver. | public void | close() Close this ObjectInputStream. | public void | defaultReadObject() Default method to read objects from the receiver. | protected boolean | enableResolveObject(boolean enable) Enables/disables object replacement for the receiver. | public int | read() Reads a single byte from the receiver and returns the result as an int. | public 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 . | public boolean | readBoolean() | public byte | readByte() | public char | readChar() | protected ObjectStreamClass | readClassDescriptor() Reads a new class descriptor from the receiver. | public double | readDouble() | public GetField | readFields() Reads the fields of the object being read from the stream. | public float | readFloat() | public void | readFully(byte[] buffer) Reads bytes from the receiver into the byte array buffer . | public void | readFully(byte[] buffer, int offset, int length) Reads bytes from the receiver into the byte array buffer . | public int | readInt() | public String | readLine() | public long | readLong() | final public Object | readObject() Read the next object from the receiver's underlying stream. | protected Object | readObjectOverride() Method to be overriden by subclasses to read the next object from the
receiver's underlying stream. | public short | readShort() | protected void | readStreamHeader() | public String | readUTF() | public Object | readUnshared() Read the next unshared object from the receiver's underlying stream. | public int | readUnsignedByte() | public int | readUnsignedShort() | public synchronized void | registerValidation(ObjectInputValidation object, int priority) Register object validator object to be executed to perform
validation of objects loaded from the receiver. | protected Class> | resolveClass(ObjectStreamClass osClass) Loads the Java class corresponding to the class descriptor
osClass (ObjectStreamClass) just read from the receiver.
Parameters: osClass - An ObjectStreamClass read from the receiver. | protected Object | resolveObject(Object object) If enableResolveObject() was activated, computes the
replacement object for the original object object and
returns the replacement. | protected Class> | resolveProxyClass(String[] interfaceNames) Retrieves the proxy class corresponding to the interface names. | public int | skipBytes(int length) Skips length bytes of primitive data from the receiver. |
ObjectInputStream | public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException(Code) | | Constructs a new ObjectInputStream on the InputStream input .
All reads are now filtered through this stream.
Parameters: input - The non-null InputStream to filter reads on. throws: IOException - If an IO exception happened when reading the stream header. throws: StreamCorruptedException - If the underlying stream does not contain serialized objectsthat can be read. |
available | public int available() throws IOException(Code) | | Returns the number of bytes of primitive data available from the
receiver. It should not be used at any arbitrary position; just when
reading primitive data types (ints, chars, etc).
the number of available primitive data bytes throws: IOException - If any IO problem occurred when trying to compute the bytesavailable. |
close | public void close() throws IOException(Code) | | Close this ObjectInputStream. This implementation closes the target
stream.
throws: IOException - If an error occurs attempting to close this stream. |
enableResolveObject | protected boolean enableResolveObject(boolean enable) throws SecurityException(Code) | | Enables/disables object replacement for the receiver. By default this is
not enabled. Only trusted subclasses (loaded with system class loader)
can override this behavior.
Parameters: enable - if true, enables replacement. If false, disables replacement. the previous configuration (if it was enabled or disabled) throws: SecurityException - If the class of the receiver is not trusted See Also: ObjectInputStream.resolveObject See Also: ObjectOutputStream.enableReplaceObject |
read | public int read() throws IOException(Code) | | 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.
The byte read or -1 if end of stream. throws: IOException - If an IO exception happened when reading the primitive data. |
read | public int read(byte[] buffer, int offset, int length) throws IOException(Code) | | 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.
Parameters: buffer - the byte array in which to store the read bytes. Parameters: offset - the offset in buffer to store the read bytes. Parameters: length - the maximum number of bytes to store in buffer . The number of bytes actually read or -1 if end of stream. throws: IOException - If an IO exception happened when reading the primitive data. |
readBoolean | public boolean readBoolean() throws IOException(Code) | | Reads and returns primitive data of type boolean read from the receiver
A boolean saved as primitive data usingObjectOutputStream.writeBoolean() throws: IOException - If an IO exception happened when reading the primitive data. |
readByte | public byte readByte() throws IOException(Code) | | Reads and returns primitive data of type byte read from the receiver
A byte saved as primitive data usingObjectOutputStream.writeByte() throws: IOException - If an IO exception happened when reading the primitive data. |
readChar | public char readChar() throws IOException(Code) | | Reads and returns primitive data of type char read from the receiver
A char saved as primitive data usingObjectOutputStream.writeChar() throws: IOException - If an IO exception happened when reading the primitive data. |
readDouble | public double readDouble() throws IOException(Code) | | Reads and returns primitive data of type double read from the receiver
A double saved as primitive data usingObjectOutputStream.writeDouble() throws: IOException - If an IO exception happened when reading the primitive data. |
readFields | public GetField readFields() throws IOException, ClassNotFoundException, NotActiveException(Code) | | Reads the fields of the object being read from the stream. The stream
will use the currently active getField object, allowing
users to load emulated fields, for cross-loading compatibility when a
class definition changes.
the fields being read throws: IOException - If an IO exception happened throws: ClassNotFoundException - If a class of an object being de-serialized can not be found throws: NotActiveException - If there is no object currently being loaded (invalid to callthis method) |
readFloat | public float readFloat() throws IOException(Code) | | Reads and returns primitive data of type float read from the receiver
A float saved as primitive data usingObjectOutputStream.writeFloat() throws: IOException - If an IO exception happened when reading the primitive data. |
readFully | public void readFully(byte[] buffer) throws IOException(Code) | | Reads bytes from the receiver into the byte array buffer .
This method will block until buffer.length number of bytes
have been read.
Parameters: buffer - the buffer to read bytes into throws: IOException - if a problem occurs reading from this stream. |
readFully | public void readFully(byte[] buffer, int offset, int length) throws IOException(Code) | | Reads bytes from the receiver into the byte array buffer .
This method will block until length number of bytes have
been read.
Parameters: buffer - the byte array in which to store the read bytes. Parameters: offset - the offset in buffer to store the read bytes. Parameters: length - the maximum number of bytes to store in buffer . throws: IOException - if a problem occurs reading from this stream. |
readInt | public int readInt() throws IOException(Code) | | Reads and returns primitive data of type int read from the receiver
an int saved as primitive data usingObjectOutputStream.writeInt() throws: IOException - If an IO exception happened when reading the primitive data. |
readLine | public String readLine() throws IOException(Code) | | Reads and returns the next line (primitive data of type String) read from
the receiver
a String saved as primitive data usingObjectOutputStream.writeLine() throws: IOException - If an IO exception happened when reading the primitive data. |
readLong | public long readLong() throws IOException(Code) | | Reads and returns primitive data of type long read from the receiver
a long saved as primitive data usingObjectOutputStream.writeLong() throws: IOException - If an IO exception happened when reading the primitive data. |
readShort | public short readShort() throws IOException(Code) | | Reads and returns primitive data of type short from the receiver
a short saved as primitive data usingObjectOutputStream.writeShort() throws: IOException - If an IO exception happened when reading the primitive data. |
readUTF | public String readUTF() throws IOException(Code) | | Reads and returns primitive data of type String read in UTF format from
the receiver
a String saved as primitive data usingObjectOutputStream.writeUTF() throws: IOException - If an IO exception happened when reading the primitive data. |
readUnsignedByte | public int readUnsignedByte() throws IOException(Code) | | Reads and returns primitive data of type byte (unsigned) from the
receiver
a byte saved as primitive data usingObjectOutputStream.writeUnsignedByte() throws: IOException - If an IO exception happened when reading the primitive data. |
readUnsignedShort | public int readUnsignedShort() throws IOException(Code) | | Reads and returns primitive data of type short (unsigned) from the
receiver
a short saved as primitive data usingObjectOutputStream.writeUnsignedShort() throws: IOException - If an IO exception happened when reading the primitive data. |
registerValidation | public synchronized void registerValidation(ObjectInputValidation object, int priority) throws NotActiveException, InvalidObjectException(Code) | | Register object validator object to be executed to perform
validation of objects loaded from the receiver. Validations will be run
in order of decreasing priority, defined by priority .
Parameters: object - An ObjectInputValidation to validate objects loaded. Parameters: priority - validator priority throws: NotActiveException - If this method is not called from readObject() throws: InvalidObjectException - If object is null. |
resolveClass | protected Class> resolveClass(ObjectStreamClass osClass) throws IOException, ClassNotFoundException(Code) | | Loads the Java class corresponding to the class descriptor
osClass (ObjectStreamClass) just read from the receiver.
Parameters: osClass - An ObjectStreamClass read from the receiver. a Class corresponding to the descriptor loaded. throws: IOException - If any IO problem occurred when trying to load the class. throws: ClassNotFoundException - If the corresponding class cannot be found. |
resolveProxyClass | protected Class> resolveProxyClass(String[] interfaceNames) throws IOException, ClassNotFoundException(Code) | | Retrieves the proxy class corresponding to the interface names.
Parameters: interfaceNames - The interfaces used to create the proxy class A proxy class throws: IOException - If any IO problem occurred when trying to load the class. throws: ClassNotFoundException - If the proxy class cannot be created |
skipBytes | public int skipBytes(int length) throws IOException(Code) | | 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).
Parameters: length - How many bytes to skip number of bytes skipped throws: IOException - If any IO problem occurred when trying to skip the bytes. |
|
|
|