public class ObjectInputStream extends DataInputStream
Streamable objects from an InputStream. Other common object types
are supported as well (@see ObjectOutputStream).Streamable| Constructor and Description |
|---|
ObjectInputStream(InputStream source)
Constructs an object input stream which will read its data from the supplied source stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTranslation(String oldname,
String newname)
Configures this object input stream with a mapping from an old class name to a new
one.
|
void |
defaultReadObject()
Reads the fields of the specified
Streamable instance from the input stream using
the default object streaming mechanisms (a call is not made to readObject(),
even if such a method exists). |
void |
readBareObject(Object object)
Reads an object from the input stream that was previously written with
ObjectOutputStream.writeBareObject(Object). |
String |
readIntern()
Reads a pooled string value from the input stream.
|
Object |
readObject()
Reads a
Streamable instance or one of the supported object types from the input
stream. |
String |
readUnmodifiedUTF()
Read a string encoded as real UTF-8 (rather than the modified format handled by
{link #readUTF}).
|
void |
setClassLoader(ClassLoader loader)
Customizes the class loader used to instantiate objects read from the input stream.
|
String |
toString() |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesavailable, close, mark, markSupported, read, reset, skippublic ObjectInputStream(InputStream source)
public void setClassLoader(ClassLoader loader)
public void addTranslation(String oldname, String newname)
public Object readObject() throws IOException, ClassNotFoundException
Streamable instance or one of the supported object types from the input
stream.IOExceptionClassNotFoundExceptionpublic String readIntern() throws IOException
IOExceptionpublic void readBareObject(Object object) throws IOException, ClassNotFoundException
ObjectOutputStream.writeBareObject(Object).object - the object to be populated from data on the stream. It cannot be
null.IOExceptionClassNotFoundExceptionpublic void defaultReadObject()
throws IOException,
ClassNotFoundException
Streamable instance from the input stream using
the default object streaming mechanisms (a call is not made to readObject(),
even if such a method exists).IOExceptionClassNotFoundExceptionpublic String readUnmodifiedUTF() throws IOException
IOExceptionCopyright © 2015. All rights reserved.