API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.io. ObjectInputStream View Source
Author(s)
Mike Warres
Roger Riggs
Since
JDK1.1
Version
1.175, 06/04/21
Serial
Hierarchy
 Object
      InputStream
          ObjectInputStream
Implements
 ObjectInput
 ObjectStreamConstants
Subclasses
Description
public class ObjectInputStream
  An ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream.
Constructors
protected ObjectInputStream () throws IOException SecurityException
  Provide a way for subclasses that are completely reimplementing ObjectInputStream to not have to allocate private data just used by this implementation of ObjectInputStream.
public ObjectInputStream (InputStream in) throws IOException
  Creates an ObjectInputStream that reads from the specified InputStream.
Methods
Hide/Show inherited methods
public int available () throws IOException [Overrides InputStream] [Specified in ObjectInput]
  Returns the number of bytes that can be read without blocking.
public void close () throws IOException [Overrides InputStream] [Specified in ObjectInput]
  Closes the input stream.
public void defaultReadObject () throws IOException ClassNotFoundException
  Read the non-static and non-transient fields of the current class from this stream.
protected boolean enableResolveObject (boolean enable) throws SecurityException
  Enable the stream to allow objects read from the stream to be replaced.
publicsynchronized void mark (int readlimit) [Inherited From InputStream]
  Marks the current position in this input stream.
public boolean markSupported () [Inherited From InputStream]
  Tests if this input stream supports the mark and reset methods.
public int read () throws IOException [Specified in ObjectInput]
  Reads a byte of data.
public int read (byte[] b) throws IOException [Inherited From InputStream]
  Reads some number of bytes from the input stream and stores them into the buffer array b.
public int read (byte[] buf, int off, int len) throws IOException [Overrides InputStream] [Specified in ObjectInput]
  Reads into an array of bytes.
public boolean readBoolean () throws IOException
  Reads in a boolean.
public byte readByte () throws IOException
  Reads an 8 bit byte.
public char readChar () throws IOException
  Reads a 16 bit char.
protected ObjectStreamClass readClassDescriptor () throws IOException ClassNotFoundException
  Read a class descriptor from the serialization stream.
public double readDouble () throws IOException
  Reads a 64 bit double.
public GetField readFields () throws IOException ClassNotFoundException
  Reads the persistent fields from the stream and makes them available by name.
public float readFloat () throws IOException
  Reads a 32 bit float.
public void readFully (byte[] buf) throws IOException
  Reads bytes, blocking until all bytes are read.
public void readFully (byte[] buf, int off, int len) throws IOException
  Reads bytes, blocking until all bytes are read.
public int readInt () throws IOException
  Reads a 32 bit int.
@Deprecated
public String readLine () throws IOException
  Reads in a line that has been terminated by a \n, \r, \r\n or EOF.
public long readLong () throws IOException
  Reads a 64 bit long.
publicfinal Object readObject () throws IOException ClassNotFoundException [Specified in ObjectInput]
  Read an object from the ObjectInputStream.
protected Object readObjectOverride () throws IOException ClassNotFoundException
  This method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor.
public short readShort () throws IOException
  Reads a 16 bit short.
protected void readStreamHeader () throws IOException StreamCorruptedException
  The readStreamHeader method is provided to allow subclasses to read and verify their own stream headers.
pack-private String readTypeString () throws IOException
  Reads string without allowing it to be replaced in stream.
public Object readUnshared () throws IOException ClassNotFoundException
  Reads an "unshared" object from the ObjectInputStream.
public int readUnsignedByte () throws IOException
  Reads an unsigned 8 bit byte.
public int readUnsignedShort () throws IOException
  Reads an unsigned 16 bit short.
public String readUTF () throws IOException
  Reads a String in modified UTF-8 format.
public void registerValidation (ObjectInputValidation obj, int prio) throws NotActiveException InvalidObjectException
  Register an object to be validated before the graph is returned.
publicsynchronized void reset () throws IOException [Inherited From InputStream]
  Repositions this stream to the position at the time the mark method was last called on this input stream.
protected Class<Object> resolveClass (ObjectStreamClass desc) throws IOException ClassNotFoundException
  Load the local class equivalent of the specified stream class description.
protected Object resolveObject (Object obj) throws IOException
  This method will allow trusted subclasses of ObjectInputStream to substitute one object for another during deserialization.
protected Class<Object> resolveProxyClass (String interfaces) throws IOException ClassNotFoundException
  Returns a proxy class that implements the interfaces named in a proxy class descriptor; subclasses may implement this method to read custom data from the stream along with the descriptors for dynamic proxy classes, allowing them to use an alternate loading mechanism for the interfaces and the proxy class.
public long skip (long n) throws IOException [Inherited From InputStream]
  Skips over and discards n bytes of data from this input stream.
public int skipBytes (int len) throws IOException
  Skips bytes.
Fields
Hide/Show inherited fields
publicfinalstatic int baseWireHandle = "8257536" [Inherited From ObjectStreamConstants]
First wire handle to be assigned.
publicfinalstatic int PROTOCOL_VERSION_1 = "1" [Inherited From ObjectStreamConstants]
  A Stream Protocol Version.
publicfinalstatic int PROTOCOL_VERSION_2 = "2" [Inherited From ObjectStreamConstants]
  A Stream Protocol Version.
publicfinalstatic byte SC_BLOCK_DATA = "8" [Inherited From ObjectStreamConstants]
  Bit mask for ObjectStreamClass flag.
publicfinalstatic byte SC_ENUM = "16" [Inherited From ObjectStreamConstants]
  Bit mask for ObjectStreamClass flag.
publicfinalstatic byte SC_EXTERNALIZABLE = "4" [Inherited From ObjectStreamConstants]
  Bit mask for ObjectStreamClass flag.
publicfinalstatic byte SC_SERIALIZABLE = "2" [Inherited From ObjectStreamConstants]
  Bit mask for ObjectStreamClass flag.
publicfinalstatic byte SC_WRITE_METHOD = "1" [Inherited From ObjectStreamConstants]
  Bit mask for ObjectStreamClass flag.
publicfinalstatic short STREAM_MAGIC = "-21267" [Inherited From ObjectStreamConstants]
Magic number that is written to the stream header.
publicfinalstatic short STREAM_VERSION = "5" [Inherited From ObjectStreamConstants]
Version number that is written to the stream header.
publicfinalstatic SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION [Inherited From ObjectStreamConstants]
  Enable overriding of readObject and writeObject.
publicfinalstatic SerializablePermission SUBSTITUTION_PERMISSION [Inherited From ObjectStreamConstants]
  Enable substitution of one object for another during serialization/deserialization.
publicfinalstatic byte TC_ARRAY = "117" [Inherited From ObjectStreamConstants]
new Array.
publicfinalstatic byte TC_BASE = "112" [Inherited From ObjectStreamConstants]
First tag value.
publicfinalstatic byte TC_BLOCKDATA = "119" [Inherited From ObjectStreamConstants]
  Block of optional data.
publicfinalstatic byte TC_BLOCKDATALONG = "122" [Inherited From ObjectStreamConstants]
  long Block data.
publicfinalstatic byte TC_CLASS = "118" [Inherited From ObjectStreamConstants]
Reference to Class.
publicfinalstatic byte TC_CLASSDESC = "114" [Inherited From ObjectStreamConstants]
new Class Descriptor.
publicfinalstatic byte TC_ENDBLOCKDATA = "120" [Inherited From ObjectStreamConstants]
End of optional block data blocks for an object.
publicfinalstatic byte TC_ENUM = "126" [Inherited From ObjectStreamConstants]
  new Enum constant.
publicfinalstatic byte TC_EXCEPTION = "123" [Inherited From ObjectStreamConstants]
Exception during write.
publicfinalstatic byte TC_LONGSTRING = "124" [Inherited From ObjectStreamConstants]
Long string.
publicfinalstatic byte TC_MAX = "126" [Inherited From ObjectStreamConstants]
Last tag value.
publicfinalstatic byte TC_NULL = "112" [Inherited From ObjectStreamConstants]
Null object reference.
publicfinalstatic byte TC_OBJECT = "115" [Inherited From ObjectStreamConstants]
new Object.
publicfinalstatic byte TC_PROXYCLASSDESC = "125" [Inherited From ObjectStreamConstants]
new Proxy Class Descriptor.
publicfinalstatic byte TC_REFERENCE = "113" [Inherited From ObjectStreamConstants]
Reference to an object already written into the stream.
publicfinalstatic byte TC_RESET = "121" [Inherited From ObjectStreamConstants]
  Reset stream context.
publicfinalstatic byte TC_STRING = "116" [Inherited From ObjectStreamConstants]
new String.
Nested Classes
  ObjectInputStream.GetField
Provide access to the persistent fields read from the input stream.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar