com.jme.util.export.binary
Class BinaryInputCapsule

java.lang.Object
  extended by com.jme.util.export.binary.BinaryInputCapsule
All Implemented Interfaces:
InputCapsule

public class BinaryInputCapsule
extends java.lang.Object
implements InputCapsule

Author:
Joshua Slack

Field Summary
protected  BinaryClassObject cObj
           
protected  java.util.HashMap<java.lang.Byte,java.lang.Object> fieldData
           
protected  BinaryImporter importer
           
protected  int index
           
 
Constructor Summary
BinaryInputCapsule(BinaryImporter importer, BinaryClassObject bco)
           
 
Method Summary
protected static byte[] inflateFrom(byte[] contents, int index)
           
protected  java.util.BitSet readBitSet(byte[] content)
           
 java.util.BitSet readBitSet(java.lang.String name, java.util.BitSet defVal)
           
protected  boolean readBoolean(byte[] content)
           
 boolean readBoolean(java.lang.String name, boolean defVal)
           
protected  boolean[] readBooleanArray(byte[] content)
           
 boolean[] readBooleanArray(java.lang.String name, boolean[] defVal)
           
protected  boolean[][] readBooleanArray2D(byte[] content)
           
 boolean[][] readBooleanArray2D(java.lang.String name, boolean[][] defVal)
           
protected  byte readByte(byte[] content)
           
 byte readByte(java.lang.String name, byte defVal)
           
protected  byte[] readByteArray(byte[] content)
           
 byte[] readByteArray(java.lang.String name, byte[] defVal)
           
protected  byte[][] readByteArray2D(byte[] content)
           
 byte[][] readByteArray2D(java.lang.String name, byte[][] defVal)
           
protected  java.nio.ByteBuffer readByteBuffer(byte[] content)
           
 java.nio.ByteBuffer readByteBuffer(java.lang.String name, java.nio.ByteBuffer defVal)
           
protected  java.util.ArrayList<java.nio.ByteBuffer> readByteBufferArrayList(byte[] content)
           
 java.util.ArrayList<java.nio.ByteBuffer> readByteBufferArrayList(java.lang.String name, java.util.ArrayList<java.nio.ByteBuffer> defVal)
           
protected  double readDouble(byte[] content)
           
 double readDouble(java.lang.String name, double defVal)
           
protected  double[] readDoubleArray(byte[] content)
           
 double[] readDoubleArray(java.lang.String name, double[] defVal)
           
protected  double[][] readDoubleArray2D(byte[] content)
           
 double[][] readDoubleArray2D(java.lang.String name, double[][] defVal)
           
<T extends java.lang.Enum<T>>
T
readEnum(java.lang.String name, java.lang.Class<T> enumType, T defVal)
           
protected  float readFloat(byte[] content)
           
 float readFloat(java.lang.String name, float defVal)
           
protected  float[] readFloatArray(byte[] content)
           
 float[] readFloatArray(java.lang.String name, float[] defVal)
           
protected  float[][] readFloatArray2D(byte[] content)
           
 float[][] readFloatArray2D(java.lang.String name, float[][] defVal)
           
protected  java.nio.FloatBuffer readFloatBuffer(byte[] content)
           
 java.nio.FloatBuffer readFloatBuffer(java.lang.String name, java.nio.FloatBuffer defVal)
           
protected  java.util.ArrayList<java.nio.FloatBuffer> readFloatBufferArrayList(byte[] content)
           
 java.util.ArrayList<java.nio.FloatBuffer> readFloatBufferArrayList(java.lang.String name, java.util.ArrayList<java.nio.FloatBuffer> defVal)
           
protected  int readInt(byte[] content)
           
 int readInt(java.lang.String name, int defVal)
           
protected  int[] readIntArray(byte[] content)
           
 int[] readIntArray(java.lang.String name, int[] defVal)
           
protected  int[][] readIntArray2D(byte[] content)
           
 int[][] readIntArray2D(java.lang.String name, int[][] defVal)
           
protected  java.nio.IntBuffer readIntBuffer(byte[] content)
           
 java.nio.IntBuffer readIntBuffer(java.lang.String name, java.nio.IntBuffer defVal)
           
protected  long readLong(byte[] content)
           
 long readLong(java.lang.String name, long defVal)
           
protected  long[] readLongArray(byte[] content)
           
 long[] readLongArray(java.lang.String name, long[] defVal)
           
protected  long[][] readLongArray2D(byte[] content)
           
 long[][] readLongArray2D(java.lang.String name, long[][] defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.ID readSavable(byte[] content)
           
 Savable readSavable(java.lang.String name, Savable defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.ID[] readSavableArray(byte[] content)
           
 Savable[] readSavableArray(java.lang.String name, Savable[] defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.ID[][] readSavableArray2D(byte[] content)
           
 Savable[][] readSavableArray2D(java.lang.String name, Savable[][] defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.ID[][][] readSavableArray3D(byte[] content)
           
 Savable[][][] readSavableArray3D(java.lang.String name, Savable[][][] defVal)
           
 java.util.ArrayList readSavableArrayList(java.lang.String name, java.util.ArrayList defVal)
           
 java.util.ArrayList[] readSavableArrayListArray(java.lang.String name, java.util.ArrayList[] defVal)
           
 java.util.ArrayList[][] readSavableArrayListArray2D(java.lang.String name, java.util.ArrayList[][] defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.ID[][] readSavableMap(byte[] content)
           
 java.util.Map<? extends Savable,? extends Savable> readSavableMap(java.lang.String name, java.util.Map<? extends Savable,? extends Savable> defVal)
           
protected  short readShort(byte[] content)
           
 short readShort(java.lang.String name, short defVal)
           
protected  short[] readShortArray(byte[] content)
           
 short[] readShortArray(java.lang.String name, short[] defVal)
           
protected  short[][] readShortArray2D(byte[] content)
           
 short[][] readShortArray2D(java.lang.String name, short[][] defVal)
           
protected  java.nio.ShortBuffer readShortBuffer(byte[] content)
           
 java.nio.ShortBuffer readShortBuffer(java.lang.String name, java.nio.ShortBuffer defVal)
           
protected  java.lang.String readString(byte[] content)
           
 java.lang.String readString(java.lang.String name, java.lang.String defVal)
           
protected  java.lang.String[] readStringArray(byte[] content)
           
 java.lang.String[] readStringArray(java.lang.String name, java.lang.String[] defVal)
           
protected  java.lang.String[][] readStringArray2D(byte[] content)
           
 java.lang.String[][] readStringArray2D(java.lang.String name, java.lang.String[][] defVal)
           
protected  com.jme.util.export.binary.BinaryInputCapsule.StringIDMap readStringSavableMap(byte[] content)
           
 java.util.Map<java.lang.String,? extends Savable> readStringSavableMap(java.lang.String name, java.util.Map<java.lang.String,? extends Savable> defVal)
           
 void setContent(byte[] content, int start, int limit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

importer

protected BinaryImporter importer

cObj

protected BinaryClassObject cObj

fieldData

protected java.util.HashMap<java.lang.Byte,java.lang.Object> fieldData

index

protected int index
Constructor Detail

BinaryInputCapsule

public BinaryInputCapsule(BinaryImporter importer,
                          BinaryClassObject bco)
Method Detail

setContent

public void setContent(byte[] content,
                       int start,
                       int limit)

readBitSet

public java.util.BitSet readBitSet(java.lang.String name,
                                   java.util.BitSet defVal)
                            throws java.io.IOException
Specified by:
readBitSet in interface InputCapsule
Throws:
java.io.IOException

readBoolean

public boolean readBoolean(java.lang.String name,
                           boolean defVal)
                    throws java.io.IOException
Specified by:
readBoolean in interface InputCapsule
Throws:
java.io.IOException

readBooleanArray

public boolean[] readBooleanArray(java.lang.String name,
                                  boolean[] defVal)
                           throws java.io.IOException
Specified by:
readBooleanArray in interface InputCapsule
Throws:
java.io.IOException

readBooleanArray2D

public boolean[][] readBooleanArray2D(java.lang.String name,
                                      boolean[][] defVal)
                               throws java.io.IOException
Specified by:
readBooleanArray2D in interface InputCapsule
Throws:
java.io.IOException

readByte

public byte readByte(java.lang.String name,
                     byte defVal)
              throws java.io.IOException
Specified by:
readByte in interface InputCapsule
Throws:
java.io.IOException

readByteArray

public byte[] readByteArray(java.lang.String name,
                            byte[] defVal)
                     throws java.io.IOException
Specified by:
readByteArray in interface InputCapsule
Throws:
java.io.IOException

readByteArray2D

public byte[][] readByteArray2D(java.lang.String name,
                                byte[][] defVal)
                         throws java.io.IOException
Specified by:
readByteArray2D in interface InputCapsule
Throws:
java.io.IOException

readByteBuffer

public java.nio.ByteBuffer readByteBuffer(java.lang.String name,
                                          java.nio.ByteBuffer defVal)
                                   throws java.io.IOException
Specified by:
readByteBuffer in interface InputCapsule
Throws:
java.io.IOException

readByteBufferArrayList

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

readDouble

public double readDouble(java.lang.String name,
                         double defVal)
                  throws java.io.IOException
Specified by:
readDouble in interface InputCapsule
Throws:
java.io.IOException

readDoubleArray

public double[] readDoubleArray(java.lang.String name,
                                double[] defVal)
                         throws java.io.IOException
Specified by:
readDoubleArray in interface InputCapsule
Throws:
java.io.IOException

readDoubleArray2D

public double[][] readDoubleArray2D(java.lang.String name,
                                    double[][] defVal)
                             throws java.io.IOException
Specified by:
readDoubleArray2D in interface InputCapsule
Throws:
java.io.IOException

readFloat

public float readFloat(java.lang.String name,
                       float defVal)
                throws java.io.IOException
Specified by:
readFloat in interface InputCapsule
Throws:
java.io.IOException

readFloatArray

public float[] readFloatArray(java.lang.String name,
                              float[] defVal)
                       throws java.io.IOException
Specified by:
readFloatArray in interface InputCapsule
Throws:
java.io.IOException

readFloatArray2D

public float[][] readFloatArray2D(java.lang.String name,
                                  float[][] defVal)
                           throws java.io.IOException
Specified by:
readFloatArray2D in interface InputCapsule
Throws:
java.io.IOException

readFloatBuffer

public java.nio.FloatBuffer readFloatBuffer(java.lang.String name,
                                            java.nio.FloatBuffer defVal)
                                     throws java.io.IOException
Specified by:
readFloatBuffer in interface InputCapsule
Throws:
java.io.IOException

readFloatBufferArrayList

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

readInt

public int readInt(java.lang.String name,
                   int defVal)
            throws java.io.IOException
Specified by:
readInt in interface InputCapsule
Throws:
java.io.IOException

readIntArray

public int[] readIntArray(java.lang.String name,
                          int[] defVal)
                   throws java.io.IOException
Specified by:
readIntArray in interface InputCapsule
Throws:
java.io.IOException

readIntArray2D

public int[][] readIntArray2D(java.lang.String name,
                              int[][] defVal)
                       throws java.io.IOException
Specified by:
readIntArray2D in interface InputCapsule
Throws:
java.io.IOException

readIntBuffer

public java.nio.IntBuffer readIntBuffer(java.lang.String name,
                                        java.nio.IntBuffer defVal)
                                 throws java.io.IOException
Specified by:
readIntBuffer in interface InputCapsule
Throws:
java.io.IOException

readLong

public long readLong(java.lang.String name,
                     long defVal)
              throws java.io.IOException
Specified by:
readLong in interface InputCapsule
Throws:
java.io.IOException

readLongArray

public long[] readLongArray(java.lang.String name,
                            long[] defVal)
                     throws java.io.IOException
Specified by:
readLongArray in interface InputCapsule
Throws:
java.io.IOException

readLongArray2D

public long[][] readLongArray2D(java.lang.String name,
                                long[][] defVal)
                         throws java.io.IOException
Specified by:
readLongArray2D in interface InputCapsule
Throws:
java.io.IOException

readSavable

public Savable readSavable(java.lang.String name,
                           Savable defVal)
                    throws java.io.IOException
Specified by:
readSavable in interface InputCapsule
Throws:
java.io.IOException

readSavableArray

public Savable[] readSavableArray(java.lang.String name,
                                  Savable[] defVal)
                           throws java.io.IOException
Specified by:
readSavableArray in interface InputCapsule
Throws:
java.io.IOException

readSavableArray2D

public Savable[][] readSavableArray2D(java.lang.String name,
                                      Savable[][] defVal)
                               throws java.io.IOException
Specified by:
readSavableArray2D in interface InputCapsule
Throws:
java.io.IOException

readSavableArray3D

public Savable[][][] readSavableArray3D(java.lang.String name,
                                        Savable[][][] defVal)
                                 throws java.io.IOException
Throws:
java.io.IOException

readSavableArrayList

public java.util.ArrayList readSavableArrayList(java.lang.String name,
                                                java.util.ArrayList defVal)
                                         throws java.io.IOException
Specified by:
readSavableArrayList in interface InputCapsule
Throws:
java.io.IOException

readSavableArrayListArray

public java.util.ArrayList[] readSavableArrayListArray(java.lang.String name,
                                                       java.util.ArrayList[] defVal)
                                                throws java.io.IOException
Specified by:
readSavableArrayListArray in interface InputCapsule
Throws:
java.io.IOException

readSavableArrayListArray2D

public java.util.ArrayList[][] readSavableArrayListArray2D(java.lang.String name,
                                                           java.util.ArrayList[][] defVal)
                                                    throws java.io.IOException
Specified by:
readSavableArrayListArray2D in interface InputCapsule
Throws:
java.io.IOException

readSavableMap

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

readStringSavableMap

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

readShort

public short readShort(java.lang.String name,
                       short defVal)
                throws java.io.IOException
Specified by:
readShort in interface InputCapsule
Throws:
java.io.IOException

readShortArray

public short[] readShortArray(java.lang.String name,
                              short[] defVal)
                       throws java.io.IOException
Specified by:
readShortArray in interface InputCapsule
Throws:
java.io.IOException

readShortArray2D

public short[][] readShortArray2D(java.lang.String name,
                                  short[][] defVal)
                           throws java.io.IOException
Specified by:
readShortArray2D in interface InputCapsule
Throws:
java.io.IOException

readShortBuffer

public java.nio.ShortBuffer readShortBuffer(java.lang.String name,
                                            java.nio.ShortBuffer defVal)
                                     throws java.io.IOException
Specified by:
readShortBuffer in interface InputCapsule
Throws:
java.io.IOException

readString

public java.lang.String readString(java.lang.String name,
                                   java.lang.String defVal)
                            throws java.io.IOException
Specified by:
readString in interface InputCapsule
Throws:
java.io.IOException

readStringArray

public java.lang.String[] readStringArray(java.lang.String name,
                                          java.lang.String[] defVal)
                                   throws java.io.IOException
Specified by:
readStringArray in interface InputCapsule
Throws:
java.io.IOException

readStringArray2D

public java.lang.String[][] readStringArray2D(java.lang.String name,
                                              java.lang.String[][] defVal)
                                       throws java.io.IOException
Specified by:
readStringArray2D in interface InputCapsule
Throws:
java.io.IOException

readByte

protected byte readByte(byte[] content)
                 throws java.io.IOException
Throws:
java.io.IOException

readByteArray

protected byte[] readByteArray(byte[] content)
                        throws java.io.IOException
Throws:
java.io.IOException

readByteArray2D

protected byte[][] readByteArray2D(byte[] content)
                            throws java.io.IOException
Throws:
java.io.IOException

readInt

protected int readInt(byte[] content)
               throws java.io.IOException
Throws:
java.io.IOException

readIntArray

protected int[] readIntArray(byte[] content)
                      throws java.io.IOException
Throws:
java.io.IOException

readIntArray2D

protected int[][] readIntArray2D(byte[] content)
                          throws java.io.IOException
Throws:
java.io.IOException

readFloat

protected float readFloat(byte[] content)
                   throws java.io.IOException
Throws:
java.io.IOException

readFloatArray

protected float[] readFloatArray(byte[] content)
                          throws java.io.IOException
Throws:
java.io.IOException

readFloatArray2D

protected float[][] readFloatArray2D(byte[] content)
                              throws java.io.IOException
Throws:
java.io.IOException

readDouble

protected double readDouble(byte[] content)
                     throws java.io.IOException
Throws:
java.io.IOException

readDoubleArray

protected double[] readDoubleArray(byte[] content)
                            throws java.io.IOException
Throws:
java.io.IOException

readDoubleArray2D

protected double[][] readDoubleArray2D(byte[] content)
                                throws java.io.IOException
Throws:
java.io.IOException

readLong

protected long readLong(byte[] content)
                 throws java.io.IOException
Throws:
java.io.IOException

readLongArray

protected long[] readLongArray(byte[] content)
                        throws java.io.IOException
Throws:
java.io.IOException

readLongArray2D

protected long[][] readLongArray2D(byte[] content)
                            throws java.io.IOException
Throws:
java.io.IOException

readShort

protected short readShort(byte[] content)
                   throws java.io.IOException
Throws:
java.io.IOException

readShortArray

protected short[] readShortArray(byte[] content)
                          throws java.io.IOException
Throws:
java.io.IOException

readShortArray2D

protected short[][] readShortArray2D(byte[] content)
                              throws java.io.IOException
Throws:
java.io.IOException

readBoolean

protected boolean readBoolean(byte[] content)
                       throws java.io.IOException
Throws:
java.io.IOException

readBooleanArray

protected boolean[] readBooleanArray(byte[] content)
                              throws java.io.IOException
Throws:
java.io.IOException

readBooleanArray2D

protected boolean[][] readBooleanArray2D(byte[] content)
                                  throws java.io.IOException
Throws:
java.io.IOException

readString

protected java.lang.String readString(byte[] content)
                               throws java.io.IOException
Throws:
java.io.IOException

readStringArray

protected java.lang.String[] readStringArray(byte[] content)
                                      throws java.io.IOException
Throws:
java.io.IOException

readStringArray2D

protected java.lang.String[][] readStringArray2D(byte[] content)
                                          throws java.io.IOException
Throws:
java.io.IOException

readBitSet

protected java.util.BitSet readBitSet(byte[] content)
                               throws java.io.IOException
Throws:
java.io.IOException

inflateFrom

protected static byte[] inflateFrom(byte[] contents,
                                    int index)

readSavable

protected com.jme.util.export.binary.BinaryInputCapsule.ID readSavable(byte[] content)
                                                                throws java.io.IOException
Throws:
java.io.IOException

readSavableArray

protected com.jme.util.export.binary.BinaryInputCapsule.ID[] readSavableArray(byte[] content)
                                                                       throws java.io.IOException
Throws:
java.io.IOException

readSavableArray2D

protected com.jme.util.export.binary.BinaryInputCapsule.ID[][] readSavableArray2D(byte[] content)
                                                                           throws java.io.IOException
Throws:
java.io.IOException

readSavableArray3D

protected com.jme.util.export.binary.BinaryInputCapsule.ID[][][] readSavableArray3D(byte[] content)
                                                                             throws java.io.IOException
Throws:
java.io.IOException

readSavableMap

protected com.jme.util.export.binary.BinaryInputCapsule.ID[][] readSavableMap(byte[] content)
                                                                       throws java.io.IOException
Throws:
java.io.IOException

readStringSavableMap

protected com.jme.util.export.binary.BinaryInputCapsule.StringIDMap readStringSavableMap(byte[] content)
                                                                                  throws java.io.IOException
Throws:
java.io.IOException

readFloatBufferArrayList

protected java.util.ArrayList<java.nio.FloatBuffer> readFloatBufferArrayList(byte[] content)
                                                                      throws java.io.IOException
Throws:
java.io.IOException

readByteBufferArrayList

protected java.util.ArrayList<java.nio.ByteBuffer> readByteBufferArrayList(byte[] content)
                                                                    throws java.io.IOException
Throws:
java.io.IOException

readFloatBuffer

protected java.nio.FloatBuffer readFloatBuffer(byte[] content)
                                        throws java.io.IOException
Throws:
java.io.IOException

readIntBuffer

protected java.nio.IntBuffer readIntBuffer(byte[] content)
                                    throws java.io.IOException
Throws:
java.io.IOException

readByteBuffer

protected java.nio.ByteBuffer readByteBuffer(byte[] content)
                                      throws java.io.IOException
Throws:
java.io.IOException

readShortBuffer

protected java.nio.ShortBuffer readShortBuffer(byte[] content)
                                        throws java.io.IOException
Throws:
java.io.IOException

readEnum

public <T extends java.lang.Enum<T>> T readEnum(java.lang.String name,
                                                java.lang.Class<T> enumType,
                                                T defVal)
                                     throws java.io.IOException
Specified by:
readEnum in interface InputCapsule
Throws:
java.io.IOException