Xj3D VRML/X3D Code API

org.web3d.vrml.export.compressors
Interface FieldDecompressor

All Known Implementing Classes:
BinaryFieldEncoder

public interface FieldDecompressor

All classes capable of decompressing a field must implement this interface

Version:
$Revision: 1.4 $
Author:
Alan Hudson.

Method Summary
 boolean canSupport(int fieldType, int method)
          Can this fieldCompressor support this compression method
 boolean decompressBoolean(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressBoolean(java.io.DataInputStream dis, int fieldType, boolean[] data)
          Decompress this field.
 double decompressDouble(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressDouble(java.io.DataInputStream dis, int fieldType, double[] data)
          Decompress this field.
 void decompressDouble(java.io.DataInputStream dis, int fieldType, double[][] data)
          Decompress this field.
 float decompressFloat(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressFloat(java.io.DataInputStream dis, int fieldType, float[] data)
          Decompress this field.
 void decompressFloat(java.io.DataInputStream dis, int fieldType, float[][] data)
          Decompress this field.
 int decompressInt(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressInt(java.io.DataInputStream dis, int fieldType, int[] data)
          Decompress this field.
 long decompressLong(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressLong(java.io.DataInputStream dis, int fieldType, long[] data)
          Decompress this field.
 java.lang.String decompressString(java.io.DataInputStream dis, int fieldType)
          Decompress this field.
 void decompressString(java.io.DataInputStream dis, int fieldType, java.lang.String[] data)
          Decompress this field.
 int nextLength(java.io.DataInputStream dis)
          Get the length of variable length field.
 

Method Detail

canSupport

public boolean canSupport(int fieldType,
                          int method)
Can this fieldCompressor support this compression method

Parameters:
fieldType - What type of field, defined in FieldConstants.
method - What method of compression. 0-127 defined by Web3D Consortium.

nextLength

public int nextLength(java.io.DataInputStream dis)
               throws java.io.IOException
Get the length of variable length field.

Returns:
The length of the upcoming field in number of type units.
Throws:
java.io.IOException

decompressInt

public int decompressInt(java.io.DataInputStream dis,
                         int fieldType)
                  throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressInt

public void decompressInt(java.io.DataInputStream dis,
                          int fieldType,
                          int[] data)
                   throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressBoolean

public boolean decompressBoolean(java.io.DataInputStream dis,
                                 int fieldType)
                          throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressBoolean

public void decompressBoolean(java.io.DataInputStream dis,
                              int fieldType,
                              boolean[] data)
                       throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressFloat

public float decompressFloat(java.io.DataInputStream dis,
                             int fieldType)
                      throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressFloat

public void decompressFloat(java.io.DataInputStream dis,
                            int fieldType,
                            float[] data)
                     throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressFloat

public void decompressFloat(java.io.DataInputStream dis,
                            int fieldType,
                            float[][] data)
                     throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressLong

public long decompressLong(java.io.DataInputStream dis,
                           int fieldType)
                    throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressLong

public void decompressLong(java.io.DataInputStream dis,
                           int fieldType,
                           long[] data)
                    throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressDouble

public double decompressDouble(java.io.DataInputStream dis,
                               int fieldType)
                        throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressDouble

public void decompressDouble(java.io.DataInputStream dis,
                             int fieldType,
                             double[] data)
                      throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressDouble

public void decompressDouble(java.io.DataInputStream dis,
                             int fieldType,
                             double[][] data)
                      throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

decompressString

public java.lang.String decompressString(java.io.DataInputStream dis,
                                         int fieldType)
                                  throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
Returns:
The field value
Throws:
java.io.IOException

decompressString

public void decompressString(java.io.DataInputStream dis,
                             int fieldType,
                             java.lang.String[] data)
                      throws java.io.IOException
Decompress this field.

Parameters:
dis - The stream to read from
fieldType - The type of field to compress from FieldConstants.
data - The field data, must be preallocated
Throws:
java.io.IOException

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium