com.jme.util.export.binary
Class BinaryOutputCapsule

java.lang.Object
  extended by com.jme.util.export.binary.BinaryOutputCapsule
All Implemented Interfaces:
OutputCapsule

public class BinaryOutputCapsule
extends java.lang.Object
implements OutputCapsule

Author:
Joshua Slack

Field Summary
protected  java.io.ByteArrayOutputStream baos
           
protected  byte[] bytes
           
protected  BinaryClassObject cObj
           
static byte[] DEFAULT_BYTES
           
static int DEFAULT_OBJECT
           
protected  BinaryExporter exporter
           
static byte[] NULL_BYTES
           
static int NULL_OBJECT
           
 
Constructor Summary
BinaryOutputCapsule(BinaryExporter exporter, BinaryClassObject bco)
           
 
Method Summary
protected static byte[] deflate(byte[] bytes)
           
 boolean equals(java.lang.Object arg0)
           
 void finish()
           
protected  void generateAlias(java.lang.String name, byte type)
           
protected  void write(java.util.BitSet value)
           
 void write(java.util.BitSet value, java.lang.String name, java.util.BitSet defVal)
           
protected  void write(boolean value)
           
protected  void write(boolean[] value)
           
protected  void write(boolean[][] value)
           
 void write(boolean[][] value, java.lang.String name, boolean[][] defVal)
           
 void write(boolean[] value, java.lang.String name, boolean[] defVal)
           
 void write(boolean value, java.lang.String name, boolean defVal)
           
protected  void write(byte value)
           
protected  void write(byte[] value)
           
protected  void write(byte[][] value)
           
 void write(byte[][] value, java.lang.String name, byte[][] defVal)
           
 void write(byte[] value, java.lang.String name, byte[] defVal)
           
protected  void write(java.nio.ByteBuffer value)
           
 void write(java.nio.ByteBuffer value, java.lang.String name, java.nio.ByteBuffer defVal)
           
 void write(byte value, java.lang.String name, byte defVal)
           
protected  void write(double value)
           
protected  void write(double[] value)
           
protected  void write(double[][] value)
           
 void write(double[][] value, java.lang.String name, double[][] defVal)
           
 void write(double[] value, java.lang.String name, double[] defVal)
           
 void write(double value, java.lang.String name, double defVal)
           
 void write(java.lang.Enum value, java.lang.String name, java.lang.Enum defVal)
           
protected  void write(float value)
           
protected  void write(float[] value)
           
protected  void write(float[][] value)
           
 void write(float[][] value, java.lang.String name, float[][] defVal)
           
 void write(float[] value, java.lang.String name, float[] defVal)
           
protected  void write(java.nio.FloatBuffer value)
           
 void write(java.nio.FloatBuffer value, java.lang.String name, java.nio.FloatBuffer defVal)
           
 void write(float value, java.lang.String name, float defVal)
           
protected  void write(int value)
           
protected  void write(int[] value)
           
protected  void write(int[][] value)
           
 void write(int[][] value, java.lang.String name, int[][] defVal)
           
 void write(int[] value, java.lang.String name, int[] defVal)
           
protected  void write(java.nio.IntBuffer value)
           
 void write(java.nio.IntBuffer value, java.lang.String name, java.nio.IntBuffer defVal)
           
 void write(int value, java.lang.String name, int defVal)
           
protected  void write(long value)
           
protected  void write(long[] value)
           
protected  void write(long[][] value)
           
 void write(long[][] value, java.lang.String name, long[][] defVal)
           
 void write(long[] value, java.lang.String name, long[] defVal)
           
 void write(long value, java.lang.String name, long defVal)
           
protected  void write(Savable object)
           
protected  void write(Savable[] objects)
           
protected  void write(Savable[][] objects)
           
 void write(Savable[][] objects, java.lang.String name, Savable[][] defVal)
           
 void write(Savable[] objects, java.lang.String name, Savable[] defVal)
           
 void write(Savable object, java.lang.String name, Savable defVal)
           
protected  void write(short value)
           
protected  void write(short[] value)
           
protected  void write(short[][] value)
           
 void write(short[][] value, java.lang.String name, short[][] defVal)
           
 void write(short[] value, java.lang.String name, short[] defVal)
           
protected  void write(java.nio.ShortBuffer value)
           
 void write(java.nio.ShortBuffer value, java.lang.String name, java.nio.ShortBuffer defVal)
           
 void write(short value, java.lang.String name, short defVal)
           
protected  void write(java.lang.String value)
           
protected  void write(java.lang.String[] value)
           
protected  void write(java.lang.String[][] value)
           
 void write(java.lang.String[][] value, java.lang.String name, java.lang.String[][] defVal)
           
 void write(java.lang.String[] value, java.lang.String name, java.lang.String[] defVal)
           
 void write(java.lang.String value, java.lang.String name, java.lang.String defVal)
           
protected  void writeAlias(java.lang.String name, byte fieldType)
           
protected  void writeByteBufferArrayList(java.util.ArrayList<java.nio.ByteBuffer> array)
           
 void writeByteBufferArrayList(java.util.ArrayList<java.nio.ByteBuffer> array, java.lang.String name, java.util.ArrayList<java.nio.ByteBuffer> defVal)
           
protected  void writeFloatBufferArrayList(java.util.ArrayList<java.nio.FloatBuffer> array)
           
 void writeFloatBufferArrayList(java.util.ArrayList<java.nio.FloatBuffer> array, java.lang.String name, java.util.ArrayList<java.nio.FloatBuffer> defVal)
           
protected  void writeSavableArrayList(java.util.ArrayList array)
           
 void writeSavableArrayList(java.util.ArrayList array, java.lang.String name, java.util.ArrayList defVal)
           
protected  void writeSavableArrayListArray(java.util.ArrayList[] array)
           
 void writeSavableArrayListArray(java.util.ArrayList[] array, java.lang.String name, java.util.ArrayList[] defVal)
           
protected  void writeSavableArrayListArray2D(java.util.ArrayList[][] array)
           
 void writeSavableArrayListArray2D(java.util.ArrayList[][] array, java.lang.String name, java.util.ArrayList[][] defVal)
           
protected  void writeSavableMap(java.util.Map<? extends Savable,? extends Savable> array)
           
 void writeSavableMap(java.util.Map<? extends Savable,? extends Savable> map, java.lang.String name, java.util.Map<? extends Savable,? extends Savable> defVal)
           
protected  void writeStringSavableMap(java.util.Map<java.lang.String,? extends Savable> array)
           
 void writeStringSavableMap(java.util.Map<java.lang.String,? extends Savable> map, java.lang.String name, java.util.Map<java.lang.String,? extends Savable> defVal)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_OBJECT

public static final int NULL_OBJECT
See Also:
Constant Field Values

DEFAULT_OBJECT

public static final int DEFAULT_OBJECT
See Also:
Constant Field Values

NULL_BYTES

public static byte[] NULL_BYTES

DEFAULT_BYTES

public static byte[] DEFAULT_BYTES

baos

protected java.io.ByteArrayOutputStream baos

bytes

protected byte[] bytes

exporter

protected BinaryExporter exporter

cObj

protected BinaryClassObject cObj
Constructor Detail

BinaryOutputCapsule

public BinaryOutputCapsule(BinaryExporter exporter,
                           BinaryClassObject bco)
Method Detail

write

public void write(byte value,
                  java.lang.String name,
                  byte defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(byte[] value,
                  java.lang.String name,
                  byte[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(byte[][] value,
                  java.lang.String name,
                  byte[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(int value,
                  java.lang.String name,
                  int defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(int[] value,
                  java.lang.String name,
                  int[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(int[][] value,
                  java.lang.String name,
                  int[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(float value,
                  java.lang.String name,
                  float defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(float[] value,
                  java.lang.String name,
                  float[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(float[][] value,
                  java.lang.String name,
                  float[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(double value,
                  java.lang.String name,
                  double defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(double[] value,
                  java.lang.String name,
                  double[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(double[][] value,
                  java.lang.String name,
                  double[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(long value,
                  java.lang.String name,
                  long defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(long[] value,
                  java.lang.String name,
                  long[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(long[][] value,
                  java.lang.String name,
                  long[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(short value,
                  java.lang.String name,
                  short defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(short[] value,
                  java.lang.String name,
                  short[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(short[][] value,
                  java.lang.String name,
                  short[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(boolean value,
                  java.lang.String name,
                  boolean defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(boolean[] value,
                  java.lang.String name,
                  boolean[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(boolean[][] value,
                  java.lang.String name,
                  boolean[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.lang.String value,
                  java.lang.String name,
                  java.lang.String defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.lang.String[] value,
                  java.lang.String name,
                  java.lang.String[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.lang.String[][] value,
                  java.lang.String name,
                  java.lang.String[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.util.BitSet value,
                  java.lang.String name,
                  java.util.BitSet defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(Savable object,
                  java.lang.String name,
                  Savable defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(Savable[] objects,
                  java.lang.String name,
                  Savable[] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(Savable[][] objects,
                  java.lang.String name,
                  Savable[][] defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.nio.FloatBuffer value,
                  java.lang.String name,
                  java.nio.FloatBuffer defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.nio.IntBuffer value,
                  java.lang.String name,
                  java.nio.IntBuffer defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.nio.ByteBuffer value,
                  java.lang.String name,
                  java.nio.ByteBuffer defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

write

public void write(java.nio.ShortBuffer value,
                  java.lang.String name,
                  java.nio.ShortBuffer defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException

writeFloatBufferArrayList

public void writeFloatBufferArrayList(java.util.ArrayList<java.nio.FloatBuffer> array,
                                      java.lang.String name,
                                      java.util.ArrayList<java.nio.FloatBuffer> defVal)
                               throws java.io.IOException
Specified by:
writeFloatBufferArrayList in interface OutputCapsule
Throws:
java.io.IOException

writeByteBufferArrayList

public void writeByteBufferArrayList(java.util.ArrayList<java.nio.ByteBuffer> array,
                                     java.lang.String name,
                                     java.util.ArrayList<java.nio.ByteBuffer> defVal)
                              throws java.io.IOException
Specified by:
writeByteBufferArrayList in interface OutputCapsule
Throws:
java.io.IOException

writeSavableArrayList

public void writeSavableArrayList(java.util.ArrayList array,
                                  java.lang.String name,
                                  java.util.ArrayList defVal)
                           throws java.io.IOException
Specified by:
writeSavableArrayList in interface OutputCapsule
Throws:
java.io.IOException

writeSavableArrayListArray

public void writeSavableArrayListArray(java.util.ArrayList[] array,
                                       java.lang.String name,
                                       java.util.ArrayList[] defVal)
                                throws java.io.IOException
Specified by:
writeSavableArrayListArray in interface OutputCapsule
Throws:
java.io.IOException

writeSavableArrayListArray2D

public void writeSavableArrayListArray2D(java.util.ArrayList[][] array,
                                         java.lang.String name,
                                         java.util.ArrayList[][] defVal)
                                  throws java.io.IOException
Specified by:
writeSavableArrayListArray2D in interface OutputCapsule
Throws:
java.io.IOException

writeSavableMap

public void writeSavableMap(java.util.Map<? extends Savable,? extends Savable> map,
                            java.lang.String name,
                            java.util.Map<? extends Savable,? extends Savable> defVal)
                     throws java.io.IOException
Specified by:
writeSavableMap in interface OutputCapsule
Throws:
java.io.IOException

writeStringSavableMap

public void writeStringSavableMap(java.util.Map<java.lang.String,? extends Savable> map,
                                  java.lang.String name,
                                  java.util.Map<java.lang.String,? extends Savable> defVal)
                           throws java.io.IOException
Specified by:
writeStringSavableMap in interface OutputCapsule
Throws:
java.io.IOException

writeAlias

protected void writeAlias(java.lang.String name,
                          byte fieldType)
                   throws java.io.IOException
Throws:
java.io.IOException

generateAlias

protected void generateAlias(java.lang.String name,
                             byte type)

equals

public boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

finish

public void finish()

write

protected void write(byte value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(byte[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(byte[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(int value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(int[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(int[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(float value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(float[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(float[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(double value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(double[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(double[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(long value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(long[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(long[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(short value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(short[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(short[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(boolean value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(boolean[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(boolean[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.lang.String value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.lang.String[] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.lang.String[][] value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.util.BitSet value)
              throws java.io.IOException
Throws:
java.io.IOException

deflate

protected static byte[] deflate(byte[] bytes)

write

protected void write(Savable object)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(Savable[] objects)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(Savable[][] objects)
              throws java.io.IOException
Throws:
java.io.IOException

writeSavableArrayList

protected void writeSavableArrayList(java.util.ArrayList array)
                              throws java.io.IOException
Throws:
java.io.IOException

writeSavableArrayListArray

protected void writeSavableArrayListArray(java.util.ArrayList[] array)
                                   throws java.io.IOException
Throws:
java.io.IOException

writeSavableArrayListArray2D

protected void writeSavableArrayListArray2D(java.util.ArrayList[][] array)
                                     throws java.io.IOException
Throws:
java.io.IOException

writeSavableMap

protected void writeSavableMap(java.util.Map<? extends Savable,? extends Savable> array)
                        throws java.io.IOException
Throws:
java.io.IOException

writeStringSavableMap

protected void writeStringSavableMap(java.util.Map<java.lang.String,? extends Savable> array)
                              throws java.io.IOException
Throws:
java.io.IOException

writeFloatBufferArrayList

protected void writeFloatBufferArrayList(java.util.ArrayList<java.nio.FloatBuffer> array)
                                  throws java.io.IOException
Throws:
java.io.IOException

writeByteBufferArrayList

protected void writeByteBufferArrayList(java.util.ArrayList<java.nio.ByteBuffer> array)
                                 throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.FloatBuffer value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.IntBuffer value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.ByteBuffer value)
              throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.ShortBuffer value)
              throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.lang.Enum value,
                  java.lang.String name,
                  java.lang.Enum defVal)
           throws java.io.IOException
Specified by:
write in interface OutputCapsule
Throws:
java.io.IOException