FileDocCategorySizeDatePackage
ObjectInput.javaAPI DocAndroid 1.5 API4403Wed May 06 22:41:04 BST 2009java.io

ObjectInput

public interface ObjectInput implements DataInput
Defines an interface for classes that allow reading serialized objects.
see
ObjectInputStream
see
ObjectOutput
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public intavailable()
Indicates the number of bytes of primitive data that can be read without blocking.

return
the number of bytes available.
throws
IOException if an I/O error occurs.
since
Android 1.0

public voidclose()
Closes this stream. Implementations of this method should free any resources used by the stream.

throws
IOException if an I/O error occurs while closing the input stream.
since
Android 1.0

public intread()
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of this stream has been reached. Blocks if no input is available.

return
the byte read or -1 if the end of this stream has been reached.
throws
IOException if this stream is closed or another I/O error occurs.
since
Android 1.0

public intread(byte[] buffer)
Reads bytes from this stream into the byte array {@code buffer}. Blocks while waiting for input.

param
buffer the array in which to store the bytes read.
return
the number of bytes read or -1 if the end of this stream has been reached.
throws
IOException if this stream is closed or another I/O error occurs.
since
Android 1.0

public intread(byte[] buffer, int offset, int count)
Reads at most {@code count} bytes from this stream and stores them in byte array {@code buffer} starting at offset {@code count}. Blocks while waiting for input.

param
buffer the array in which to store the bytes read.
param
offset the initial position in {@code buffer} to store the bytes read from this stream.
param
count the maximum number of bytes to store in {@code buffer}.
return
the number of bytes read or -1 if the end of this stream has been reached.
throws
IOException if this stream is closed or another I/O error occurs.
since
Android 1.0

public java.lang.ObjectreadObject()
Reads the next object from this stream.

return
the object read.
throws
ClassNotFoundException if the object's class cannot be found.
throws
IOException if this stream is closed or another I/O error occurs.
since
Android 1.0

public longskip(long toSkip)
Skips {@code toSkip} bytes on this stream. Less than {@code toSkip} byte are skipped if the end of this stream is reached before the operation completes.

param
toSkip the number of bytes to skip.
return
the number of bytes actually skipped.
throws
IOException if this stream is closed or another I/O error occurs.
since
Android 1.0