CTL.Streams
Class OOStream

java.lang.Object
  extended by CTL.Streams.DataOutputStream2
      extended by CTL.Serialize.SerialOut
          extended by CTL.Streams.OOStream
All Implemented Interfaces:
OutStream, java.io.DataOutput
Direct Known Subclasses:
IStream2

public class OOStream
extends SerialOut
implements OutStream

ObjectOutputStream clone for the CTL


Nested Class Summary
static class OOStream.Serial
           
 
Field Summary
private  SerialOut stream
           
private  boolean swapBytes
           
 
Constructor Summary
OOStream(java.io.OutputStream out)
          Generate a new stream
OOStream(java.io.OutputStream out, OOStream.Serial type)
          Constructor
 
Method Summary
<T> void
__writeArray(T data)
           
 void changeEndianess(java.nio.ByteOrder order)
           
 void close()
           
 void flush()
           
 void serialWrite(java.lang.Object data)
          Write an object to the stream (if one of the above function applies better to the data given, the relevant function will be called automagically.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int i)
           
<T> void
writeArray(T data)
           
 void writeBoolean(boolean v)
           
 void writeByte(int v)
           
 void writeBytes(java.lang.String s)
           
 void writeChar(int v)
           
 void writeChars(java.lang.String s)
           
protected  void writeData(java.lang.Object data)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeObject(java.lang.Object data)
           
 void writeShort(int v)
           
 void writeString(java.lang.String s)
           
 void writeUTF(java.lang.String s)
           
 void writeWString(java.lang.String s)
           
 
Methods inherited from class CTL.Streams.DataOutputStream2
writeByte, writeChar, writeShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

swapBytes

private boolean swapBytes

stream

private SerialOut stream
Constructor Detail

OOStream

public OOStream(java.io.OutputStream out)
         throws java.io.IOException,
                CTLException
Generate a new stream

Parameters:
out - Underlying output stream
Throws:
java.io.IOException
CTLException

OOStream

public OOStream(java.io.OutputStream out,
                OOStream.Serial type)
         throws CTLException,
                java.io.IOException
Constructor

Throws:
CTLException
java.io.IOException
Method Detail

changeEndianess

public void changeEndianess(java.nio.ByteOrder order)

serialWrite

public void serialWrite(java.lang.Object data)
                 throws java.io.IOException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        CTLException
Description copied from class: SerialOut
Write an object to the stream (if one of the above function applies better to the data given, the relevant function will be called automagically.

Specified by:
serialWrite in interface OutStream
Overrides:
serialWrite in class SerialOut
Parameters:
data - Value
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException

flush

public void flush()
           throws java.io.IOException
Overrides:
flush in class DataOutputStream2
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Overrides:
close in class DataOutputStream2
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String s)
                 throws java.io.IOException
Specified by:
writeString in interface OutStream
Specified by:
writeString in class SerialOut
Throws:
java.io.IOException

writeArray

public <T> void writeArray(T data)
                throws java.io.IOException,
                       java.lang.IllegalAccessException,
                       java.lang.reflect.InvocationTargetException
Specified by:
writeArray in interface OutStream
Specified by:
writeArray in class SerialOut
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Specified by:
writeBytes in interface java.io.DataOutput
Overrides:
writeBytes in class DataOutputStream2
Throws:
java.io.IOException

writeLong

public void writeLong(long v)
               throws java.io.IOException
Specified by:
writeLong in interface java.io.DataOutput
Overrides:
writeLong in class DataOutputStream2
Throws:
java.io.IOException

writeInt

public void writeInt(int v)
              throws java.io.IOException
Specified by:
writeInt in interface java.io.DataOutput
Overrides:
writeInt in class DataOutputStream2
Throws:
java.io.IOException

write

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

writeObject

public void writeObject(java.lang.Object data)
                 throws java.io.IOException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        CTLException
Specified by:
writeObject in interface OutStream
Specified by:
writeObject in class SerialOut
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException

__writeArray

public <T> void __writeArray(T data)
                  throws java.io.IOException,
                         java.lang.IllegalAccessException,
                         java.lang.reflect.InvocationTargetException
Specified by:
__writeArray in interface OutStream
Specified by:
__writeArray in class SerialOut
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

writeWString

public void writeWString(java.lang.String s)
                  throws java.io.IOException
Specified by:
writeWString in interface OutStream
Specified by:
writeWString in class SerialOut
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String s)
              throws java.io.IOException
Specified by:
writeUTF in interface java.io.DataOutput
Overrides:
writeUTF in class DataOutputStream2
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Specified by:
writeChars in interface java.io.DataOutput
Overrides:
writeChars in class DataOutputStream2
Throws:
java.io.IOException

writeDouble

public void writeDouble(double v)
                 throws java.io.IOException
Specified by:
writeDouble in interface java.io.DataOutput
Overrides:
writeDouble in class DataOutputStream2
Throws:
java.io.IOException

writeFloat

public void writeFloat(float v)
                throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Overrides:
writeFloat in class DataOutputStream2
Throws:
java.io.IOException

writeChar

public void writeChar(int v)
               throws java.io.IOException
Specified by:
writeChar in interface java.io.DataOutput
Overrides:
writeChar in class DataOutputStream2
Throws:
java.io.IOException

writeShort

public void writeShort(int v)
                throws java.io.IOException
Specified by:
writeShort in interface java.io.DataOutput
Overrides:
writeShort in class DataOutputStream2
Throws:
java.io.IOException

writeByte

public void writeByte(int v)
               throws java.io.IOException
Specified by:
writeByte in interface java.io.DataOutput
Overrides:
writeByte in class DataOutputStream2
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean v)
                  throws java.io.IOException
Specified by:
writeBoolean in interface java.io.DataOutput
Overrides:
writeBoolean in class DataOutputStream2
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class DataOutputStream2
Throws:
java.io.IOException

write

public void write(int i)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class DataOutputStream2
Throws:
java.io.IOException

writeData

protected void writeData(java.lang.Object data)
                  throws java.io.IOException,
                         java.lang.IllegalAccessException,
                         java.lang.reflect.InvocationTargetException,
                         CTLException
Specified by:
writeData in class SerialOut
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
CTLException