ObjectInputStream

public class ObjectInputStream extends InputStream
implements ObjectInput ObjectStreamConstants

A specialized InputStream that is able to read (deserialize) Java objects as well as primitive data types (int, byte, char etc.). The data has typically been saved using an ObjectOutputStream.

Nested Class Summary

class ObjectInputStream.GetField GetField is an inner class that provides access to the persistent fields read from the source stream. 

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

ObjectInputStream(InputStream input)
Constructs a new ObjectInputStream that reads from the InputStream input.

Protected Constructor Summary

ObjectInputStream()
Constructs a new ObjectInputStream.

Public Method Summary

int
available()
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.
void
close()
Closes this stream.
void
defaultReadObject()
Default method to read objects from this stream.
int
read()
Reads a single byte from the source stream and returns it as an integer in the range from 0 to 255.
int
read(byte[] buffer, int byteOffset, int byteCount)
Reads at most length bytes from the source stream and stores them in byte array buffer starting at offset count.
boolean
readBoolean()
Reads a boolean from the source stream.
byte
readByte()
Reads a byte (8 bit) from the source stream.
char
readChar()
Reads a character (16 bit) from the source stream.
double
readDouble()
Reads a double (64 bit) from the source stream.
ObjectInputStream.GetField
readFields()
Reads the persistent fields of the object that is currently being read from the source stream.
float
readFloat()
Reads a float (32 bit) from the source stream.
void
readFully(byte[] dst)
Reads bytes from the source stream into the byte array dst.
void
readFully(byte[] dst, int offset, int byteCount)
Reads byteCount bytes from the source stream into the byte array dst.
int
readInt()
Reads an integer (32 bit) from the source stream.
String
readLine()
This method was deprecated. Use BufferedReader instead.
long
readLong()
Reads a long (64 bit) from the source stream.
final Object
readObject()
Reads the next object from the source stream.
short
readShort()
Reads a short (16 bit) from the source stream.
String
readUTF()
Reads a string encoded in modified UTF-8 from the source stream.
Object
readUnshared()
Reads the next unshared o