This is an imitation ObjectInputStream class that provides the ObjectInput interface by delegating to an object that implements the ObjectInput interface. Primarily, this is intended as a base class for building specific-purpose ObjectInput wrappers.

Author:

cp 2004.08.20

Constructor Summary

WrapperObjectInputStream(java.io.ObjectInput in)
Construct a WrapperObjectInputStream that will read from the specified object implementing the ObjectInput interface.

Method Summary

int

available()
Returns the number of bytes that can be read (or skipped over) from this input stream without causing a blocking I/O condition to occur.

void

close()
Close the InputStream and release any system resources associated with it.

java.io.ObjectInput

getObjectInput()
Obtain the underlying object providing the ObjectInput interface that this object is delegating to.

the number of bytes read from the stream, or -1 if no bytes were read from the stream because the end of the stream had been reached

Throws:

java.lang.NullPointerException - if the passed array is null

java.lang.IndexOutOfBoundsException - if of or cb is negative, or of+cb is greater than the length of the ab

java.io.IOException - if an I/O error occurs

skip

public long skip(long cb)
throws java.io.IOException

Skips over up to the specified number of bytes of data from this InputStream. The number of bytes actually skipped over may be fewer than the number specified to skip, and may even be zero; this can be caused by an end-of-file condition, but can also occur even when there is data remaining in the InputStream. As a result, the caller should check the return value from this method, which indicates the actual number of bytes skipped.

available

public int available()
throws java.io.IOException

Returns the number of bytes that can be read (or skipped over) from this input stream without causing a blocking I/O condition to occur. This method reflects the assumed implementation of various buffering InputStreams, which can guarantee non-blocking reads up to the extent of their buffers, but beyond that the read operations will have to read from some underlying (and potentially blocking) source.