com.github.libxjava.io
Class BinaryDeserialiserStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.DataInputStream
          extended by com.github.libxjava.io.BinaryDeserialiserStream
All Implemented Interfaces:
IDeserialiser, DataInput

public class BinaryDeserialiserStream
extends DataInputStream
implements IDeserialiser

Version:
libxjava-cldc - 0.3
Author:
Marcel Patzlaff

Field Summary
protected  int referenceCounter
           
 
Fields inherited from class java.io.DataInputStream
in
 
Constructor Summary
BinaryDeserialiserStream(IClassLoader classLoader, InputStream in)
           
 
Method Summary
 void flush()
          Clears the internal deserialisation graphs.
protected  Object getReference(byte num)
           
 Object readObject()
          Reads the next content of the underlying stream and interprets it as an Object.
 
Methods inherited from class java.io.DataInputStream
available, close, mark, markSupported, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, reset, skip, skipBytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Field Detail

referenceCounter

protected int referenceCounter
Constructor Detail

BinaryDeserialiserStream

public BinaryDeserialiserStream(IClassLoader classLoader,
                                InputStream in)
Method Detail

flush

public void flush()
Description copied from interface: IDeserialiser
Clears the internal deserialisation graphs. This method should be called to process further content on the underlying stream which is not associated with the previously deserialised one. It has no effect on the underlying inputstream.

Specified by:
flush in interface IDeserialiser

readObject

public final Object readObject()
                        throws ClassNotFoundException,
                               IOException
Description copied from interface: IDeserialiser
Reads the next content of the underlying stream and interprets it as an Object.

Specified by:
readObject in interface IDeserialiser
Returns:
the object created from the stream
Throws:
ClassNotFoundException - if a class could not be found, instantiated or accessed.
IOException - when problems occur while reading data

getReference

protected Object getReference(byte num)


Copyright © 2011 Marcel Patzlaff. All Rights Reserved.