CTL.Serialize
Class ASCIIOut

java.lang.Object
  extended by CTL.Streams.DataOutputStream2
      extended by CTL.Serialize.SerialOut
          extended by CTL.Serialize.CTLOut
              extended by CTL.Serialize.ASCIIOut
All Implemented Interfaces:
java.io.DataOutput

public class ASCIIOut
extends CTLOut

Human-readable output. Acts as a proof-of-concept for pluggable serializers.


Field Summary
private  CTLOut file
           
 
Constructor Summary
ASCIIOut(java.io.OutputStream out, java.io.OutputStream file)
           
 
Method Summary
<T> void
__writeArray(T data)
          Write the array's elements to the stream
 void close()
           
private  void dump(java.lang.String s)
           
 void flush()
           
<T> void
writeArray(T data)
          Write an array to the stream
 void writeBoolean(boolean data)
           
 void writeByte(byte data)
           
 void writeChar(char data)
           
protected  void writeData(java.lang.Object data)
           
 void writeDouble(double data)
           
 void writeFloat(float data)
           
 void writeInt(int data)
           
 void writeLong(long data)
           
 void writeObject(java.lang.Object data)
          Write an object to the stream (Any-Object)
 void writeShort(short data)
           
 void writeString(java.lang.String data)
          Write a string to the stream (C-style one byte characters)
 void writeWString(java.lang.String data)
          Write a standard Java wide string (2 byte chars) to the stream
 
Methods inherited from class CTL.Serialize.SerialOut
serialWrite
 
Methods inherited from class CTL.Streams.DataOutputStream2
write, write, write, writeByte, writeBytes, writeChar, writeChars, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private CTLOut file
Constructor Detail

ASCIIOut

public ASCIIOut(java.io.OutputStream out,
                java.io.OutputStream file)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

dump

private void dump(java.lang.String s)
           throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

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

writeByte

public void writeByte(byte data)
               throws java.io.IOException
Overrides:
writeByte in class DataOutputStream2
Throws:
java.io.IOException

writeChar

public void writeChar(char data)
               throws java.io.IOException
Overrides:
writeChar in class DataOutputStream2
Throws:
java.io.IOException

writeDouble

public void writeDouble(double data)
                 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 data)
                throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Overrides:
writeFloat in class DataOutputStream2
Throws:
java.io.IOException

writeInt

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

writeLong

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

writeShort

public void writeShort(short data)
                throws java.io.IOException
Overrides:
writeShort in class DataOutputStream2
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String data)
                 throws java.io.IOException
Description copied from class: CTLOut
Write a string to the stream (C-style one byte characters)

Overrides:
writeString in class CTLOut
Parameters:
data - Value
Throws:
java.io.IOException

writeWString

public void writeWString(java.lang.String data)
                  throws java.io.IOException
Description copied from class: CTLOut
Write a standard Java wide string (2 byte chars) to the stream

Overrides:
writeWString in class CTLOut
Parameters:
data - Value
Throws:
java.io.IOException

writeData

protected void writeData(java.lang.Object data)
                  throws java.io.IOException,
                         java.lang.IllegalAccessException,
                         java.lang.reflect.InvocationTargetException,
                         CTLException
Overrides:
writeData in class CTLOut
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
Description copied from class: CTLOut
Write an array to the stream

Overrides:
writeArray in class CTLOut
Parameters:
data - Value
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

__writeArray

public <T> void __writeArray(T data)
                  throws java.io.IOException,
                         java.lang.IllegalAccessException,
                         java.lang.reflect.InvocationTargetException
Description copied from class: CTLOut
Write the array's elements to the stream

Overrides:
__writeArray in class CTLOut
Parameters:
data - Value
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

writeObject

public void writeObject(java.lang.Object data)
                 throws java.io.IOException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        CTLException
Description copied from class: CTLOut
Write an object to the stream (Any-Object)

Overrides:
writeObject in class CTLOut
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