CTL.Streams
Class OIStream

java.lang.Object
  extended by CTL.Streams.DataInputStream2
      extended by CTL.Serialize.SerialIn
          extended by CTL.Streams.OIStream
All Implemented Interfaces:
InStream, java.io.DataInput

public class OIStream
extends SerialIn
implements InStream

ObjectInputStream clone for the CTL


Field Summary
private  SerialIn stream
           
 
Constructor Summary
OIStream(java.io.InputStream in)
          Generate a new stream
OIStream(java.io.InputStream in, OOStream.Serial type)
          Constructor
 
Method Summary
<T> T[]
__readArray(java.lang.Class<T> type, java.util.LinkedList<TypeTree> params, int len)
           
 void changeEndianess(java.nio.ByteOrder order)
           
 int read(byte[] b)
           
<T> T[]
readArray(java.lang.Class<T> type, java.util.LinkedList<TypeTree> params)
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 java.lang.String readLine()
           
 long readLong()
           
 java.lang.Object readObject()
           
 short readShort()
           
 java.lang.String readString()
           
 Tupel readTupel(java.lang.Class[] types)
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 java.lang.String readWString()
           
 java.lang.Object serialRead(java.lang.Class... args)
           
<T> T
serialRead(java.lang.Class<T> klass)
           
 java.lang.Object serialRead(TypeTree tree)
          Read an object from the stream
 int skipBytes(int n)
           
 
Methods inherited from class CTL.Streams.DataInputStream2
available
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

private SerialIn stream
Constructor Detail

OIStream

public OIStream(java.io.InputStream in)
         throws java.io.IOException,
                CTLException
Generate a new stream

Parameters:
in - Underlying input stream
Throws:
java.io.IOException
CTLException

OIStream

public OIStream(java.io.InputStream in,
                OOStream.Serial type)
         throws java.io.IOException,
                CTLException
Constructor

Throws:
java.io.IOException
CTLException
Method Detail

changeEndianess

public void changeEndianess(java.nio.ByteOrder order)
Overrides:
changeEndianess in class DataInputStream2

serialRead

public java.lang.Object serialRead(TypeTree tree)
                            throws java.io.IOException,
                                   java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException,
                                   java.lang.reflect.InvocationTargetException
Description copied from class: SerialIn
Read an object from the stream

Specified by:
serialRead in interface InStream
Overrides:
serialRead in class SerialIn
Parameters:
tree - TypeTree to read
Returns:
Value
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

serialRead

public java.lang.Object serialRead(java.lang.Class... args)
                            throws java.io.IOException,
                                   java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException,
                                   java.lang.reflect.InvocationTargetException
Specified by:
serialRead in interface InStream
Overrides:
serialRead in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

serialRead

public <T> T serialRead(java.lang.Class<T> klass)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException,
                    java.lang.InstantiationException,
                    java.lang.IllegalAccessException,
                    java.lang.reflect.InvocationTargetException
Specified by:
serialRead in interface InStream
Overrides:
serialRead in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class DataInputStream2
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Specified by:
readInt in interface java.io.DataInput
Overrides:
readInt in class DataInputStream2
Throws:
java.io.IOException

readString

public java.lang.String readString()
                            throws java.io.IOException
Specified by:
readString in interface InStream
Specified by:
readString in class SerialIn
Throws:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Specified by:
readLong in interface java.io.DataInput
Overrides:
readLong in class DataInputStream2
Throws:
java.io.IOException

readArray

public <T> T[] readArray(java.lang.Class<T> type,
                         java.util.LinkedList<TypeTree> params)
              throws java.io.IOException,
                     java.lang.ClassNotFoundException,
                     java.lang.InstantiationException,
                     java.lang.IllegalAccessException,
                     java.lang.reflect.InvocationTargetException
Specified by:
readArray in interface InStream
Specified by:
readArray in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

__readArray

public <T> T[] __readArray(java.lang.Class<T> type,
                           java.util.LinkedList<TypeTree> params,
                           int len)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException,
                       java.lang.InstantiationException,
                       java.lang.IllegalAccessException,
                       java.lang.reflect.InvocationTargetException
Specified by:
__readArray in interface InStream
Specified by:
__readArray in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

readTupel

public Tupel readTupel(java.lang.Class[] types)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException,
                       java.lang.InstantiationException,
                       java.lang.IllegalAccessException,
                       java.lang.reflect.InvocationTargetException,
                       CTLException
Specified by:
readTupel in interface InStream
Specified by:
readTupel in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException

readObject

public java.lang.Object readObject()
                            throws java.io.IOException,
                                   java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException,
                                   java.lang.reflect.InvocationTargetException
Specified by:
readObject in interface InStream
Specified by:
readObject in class SerialIn
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Specified by:
readBoolean in interface java.io.DataInput
Overrides:
readBoolean in class DataInputStream2
Throws:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Specified by:
readFloat in interface java.io.DataInput
Overrides:
readFloat in class DataInputStream2
Throws:
java.io.IOException

readWString

public java.lang.String readWString()
                             throws java.io.IOException
Specified by:
readWString in interface InStream
Specified by:
readWString in class SerialIn
Throws:
java.io.IOException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Specified by:
readUTF in interface java.io.DataInput
Overrides:
readUTF in class DataInputStream2
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Specified by:
readLine in interface java.io.DataInput
Overrides:
readLine in class DataInputStream2
Throws:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Specified by:
readDouble in interface java.io.DataInput
Overrides:
readDouble in class DataInputStream2
Throws:
java.io.IOException

readChar

public char readChar()
              throws java.io.IOException
Specified by:
readChar in interface java.io.DataInput
Overrides:
readChar in class DataInputStream2
Throws:
java.io.IOException

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException
Specified by:
readUnsignedShort in interface java.io.DataInput
Overrides:
readUnsignedShort in class DataInputStream2
Throws:
java.io.IOException

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Specified by:
readUnsignedByte in interface java.io.DataInput
Overrides:
readUnsignedByte in class DataInputStream2
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Specified by:
readShort in interface java.io.DataInput
Overrides:
readShort in class DataInputStream2
Throws:
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Specified by:
readByte in interface java.io.DataInput
Overrides:
readByte in class DataInputStream2
Throws:
java.io.IOException

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Specified by:
skipBytes in interface java.io.DataInput
Overrides:
skipBytes in class DataInputStream2
Throws:
java.io.IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Overrides:
readFully in class DataInputStream2
Throws:
java.io.IOException

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Overrides:
readFully in class DataInputStream2
Throws:
java.io.IOException