org.granite.messaging.amf.io
Class AMF3Serializer

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by org.granite.messaging.amf.io.AMF3Serializer
All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, AMF3Constants

public class AMF3Serializer
extends DataOutputStream
implements ObjectOutput, AMF3Constants

Author:
Franck WOLFF

Field Summary
protected  Channel channel
           
protected  GraniteContext context
           
protected  Converters converters
           
protected  boolean debug
           
protected  boolean debugMore
           
protected  boolean externalizeBigDecimal
           
protected  boolean externalizeBigInteger
           
protected  boolean externalizeLong
           
protected static Logger log
           
protected static Logger logMore
           
protected  Map<String,IndexedJavaClassDescriptor> storedClassDescriptors
           
protected  Map<Object,Integer> storedObjects
           
protected  Map<String,Integer> storedStrings
           
protected  boolean warnOnChannelIdMissing
           
protected  XMLUtil xmlUtil
           
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Fields inherited from interface org.granite.messaging.amf.AMF3Constants
AMF3_ARRAY, AMF3_BOOLEAN_FALSE, AMF3_BOOLEAN_TRUE, AMF3_BYTEARRAY, AMF3_DATE, AMF3_INTEGER, AMF3_INTEGER_MAX, AMF3_INTEGER_MIN, AMF3_NULL, AMF3_NUMBER, AMF3_OBJECT, AMF3_STRING, AMF3_UNDEFINED, AMF3_VECTOR_INT, AMF3_VECTOR_NUMBER, AMF3_VECTOR_OBJECT, AMF3_VECTOR_UINT, AMF3_XML, AMF3_XMLSTRING
 
Constructor Summary
AMF3Serializer(OutputStream out)
           
AMF3Serializer(OutputStream out, boolean warnOnChannelMissing)
           
 
Method Summary
protected  IndexedJavaClassDescriptor addToStoredClassDescriptors(Class<?> clazz)
           
protected  void addToStoredObjects(Object o)
           
protected  void addToStoredStrings(String s)
           
protected  Channel getChannel()
           
protected  IndexedJavaClassDescriptor getFromStoredClassDescriptors(Class<?> clazz)
           
protected  int indexOfStoredObjects(Object o)
           
protected  int indexOfStoredStrings(String s)
           
protected  void writeAMF3Array(Object array)
           
protected  void writeAMF3ByteArray(byte[] bytes)
           
protected  void writeAMF3Collection(Collection<?> c)
           
protected  void writeAMF3Date(Date date)
           
protected  void writeAMF3Integer(int i)
           
protected  void writeAMF3IntegerData(int i)
           
protected  void writeAMF3Number(double d)
           
protected  void writeAMF3Object(Object o)
           
protected  void writeAMF3String(String s)
           
protected  void writeAMF3StringData(String s)
           
protected  void writeAMF3Xml(Document doc)
           
 void writeObject(Object o)
           
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectOutput
close, flush, write, write, write
 
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 

Field Detail

log

protected static final Logger log

logMore

protected static final Logger logMore

storedStrings

protected final Map<String,Integer> storedStrings

storedObjects

protected final Map<Object,Integer> storedObjects

storedClassDescriptors

protected final Map<String,IndexedJavaClassDescriptor> storedClassDescriptors

context

protected final GraniteContext context

converters

protected final Converters converters

externalizeLong

protected final boolean externalizeLong

externalizeBigInteger

protected final boolean externalizeBigInteger

externalizeBigDecimal

protected final boolean externalizeBigDecimal

xmlUtil

protected final XMLUtil xmlUtil

warnOnChannelIdMissing

protected final boolean warnOnChannelIdMissing

debug

protected final boolean debug

debugMore

protected final boolean debugMore

channel

protected Channel channel
Constructor Detail

AMF3Serializer

public AMF3Serializer(OutputStream out)

AMF3Serializer

public AMF3Serializer(OutputStream out,
                      boolean warnOnChannelMissing)
Method Detail

writeObject

public void writeObject(Object o)
                 throws IOException
Specified by:
writeObject in interface ObjectOutput
Throws:
IOException

writeAMF3Integer

protected void writeAMF3Integer(int i)
                         throws IOException
Throws:
IOException

writeAMF3IntegerData

protected void writeAMF3IntegerData(int i)
                             throws IOException
Throws:
IOException

writeAMF3Number

protected void writeAMF3Number(double d)
                        throws IOException
Throws:
IOException

writeAMF3String

protected void writeAMF3String(String s)
                        throws IOException
Throws:
IOException

writeAMF3StringData

protected void writeAMF3StringData(String s)
                            throws IOException
Throws:
IOException

writeAMF3Xml

protected void writeAMF3Xml(Document doc)
                     throws IOException
Throws:
IOException

writeAMF3Date

protected void writeAMF3Date(Date date)
                      throws IOException
Throws:
IOException

writeAMF3Array

protected void writeAMF3Array(Object array)
                       throws IOException
Throws:
IOException

writeAMF3ByteArray

protected void writeAMF3ByteArray(byte[] bytes)
                           throws IOException
Throws:
IOException

writeAMF3Collection

protected void writeAMF3Collection(Collection<?> c)
                            throws IOException
Throws:
IOException

writeAMF3Object

protected void writeAMF3Object(Object o)
                        throws IOException
Throws:
IOException

addToStoredStrings

protected void addToStoredStrings(String s)

indexOfStoredStrings

protected int indexOfStoredStrings(String s)

addToStoredObjects

protected void addToStoredObjects(Object o)

indexOfStoredObjects

protected int indexOfStoredObjects(Object o)

addToStoredClassDescriptors

protected IndexedJavaClassDescriptor addToStoredClassDescriptors(Class<?> clazz)

getFromStoredClassDescriptors

protected IndexedJavaClassDescriptor getFromStoredClassDescriptors(Class<?> clazz)

getChannel

protected Channel getChannel()