Class BinaryFieldEncoder
java.lang.Object
org.web3d.vrml.export.compressors.BinaryFieldEncoder
- All Implemented Interfaces:
FieldCompressor,FieldDecompressor
- Direct Known Subclasses:
RangeCompressor
A field compressor that just encodes the data in binary form.
- Version:
- $Revision: 1.7 $
- Author:
- Alan Hudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSupport(int fieldType, int method) Can this fieldCompressor support this compression methodvoidcompress(DataOutputStream dos, int fieldType, boolean data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, boolean[] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, double data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, double[] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, double[][] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, float data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, float[] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, float[][] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, int data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, int[] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, long data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, long[] data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, String data) Compress this field and deposit the output to the bitstreamvoidcompress(DataOutputStream dos, int fieldType, String[] data) Compress this field and deposit the output to the bitstreambooleandecompressBoolean(DataInputStream dis, int fieldType) Decompress this field.voiddecompressBoolean(DataInputStream dis, int fieldType, boolean[] data) Decompress this field.doubledecompressDouble(DataInputStream dis, int fieldType) Decompress this field.voiddecompressDouble(DataInputStream dis, int fieldType, double[] data) Decompress this field.voiddecompressDouble(DataInputStream dis, int fieldType, double[][] data) Decompress this field.floatdecompressFloat(DataInputStream dis, int fieldType) Decompress this field.voiddecompressFloat(DataInputStream dis, int fieldType, float[] data) Decompress this field.If the array is too small it will be realloacted.voiddecompressFloat(DataInputStream dis, int fieldType, float[][] data) Decompress this field.intdecompressInt(DataInputStream dis, int fieldType) Decompress this field.voiddecompressInt(DataInputStream dis, int fieldType, int[] data) Decompress this field.longdecompressLong(DataInputStream dis, int fieldType) Decompress this field.voiddecompressLong(DataInputStream dis, int fieldType, long[] data) Decompress this field.decompressString(DataInputStream dis, int fieldType) Decompress this field.voiddecompressString(DataInputStream dis, int fieldType, String[] data) Decompress this field.intGet the length of variable length field.
-
Constructor Details
-
BinaryFieldEncoder
public BinaryFieldEncoder()
-
-
Method Details
-
canSupport
public boolean canSupport(int fieldType, int method) Can this fieldCompressor support this compression method- Specified by:
canSupportin interfaceFieldCompressor- Specified by:
canSupportin interfaceFieldDecompressor- Parameters:
fieldType- What type of field, defined in FieldConstants.method- What method of compression. 0-127 defined by Web3D Consortium.- Returns:
-
nextLength
Get the length of variable length field.- Specified by:
nextLengthin interfaceFieldDecompressor- Parameters:
dis-- Returns:
- The length of the upcoming field in number of type units.
- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
compress
Compress this field and deposit the output to the bitstream- Specified by:
compressin interfaceFieldCompressor- Parameters:
dos- The stream to output the resultfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressInt
Decompress this field.- Specified by:
decompressIntin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- data The field data
- Throws:
IOException
-
decompressInt
Decompress this field.- Specified by:
decompressIntin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressBoolean
Decompress this field.- Specified by:
decompressBooleanin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- The field value
- Throws:
IOException
-
decompressBoolean
public void decompressBoolean(DataInputStream dis, int fieldType, boolean[] data) throws IOException Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressBooleanin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressFloat
Decompress this field.- Specified by:
decompressFloatin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- The field value
- Throws:
IOException
-
decompressFloat
Decompress this field.If the array is too small it will be realloacted.- Specified by:
decompressFloatin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressFloat
Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressFloatin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressLong
Decompress this field.- Specified by:
decompressLongin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- The field value
- Throws:
IOException
-
decompressLong
Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressLongin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressDouble
Decompress this field.- Specified by:
decompressDoublein interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- The field value
- Throws:
IOException
-
decompressDouble
Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressDoublein interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressDouble
public void decompressDouble(DataInputStream dis, int fieldType, double[][] data) throws IOException Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressDoublein interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-
decompressString
Decompress this field.- Specified by:
decompressStringin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.- Returns:
- The field value
- Throws:
IOException
-
decompressString
Decompress this field. If the array is too small it will be realloacted.- Specified by:
decompressStringin interfaceFieldDecompressor- Parameters:
dis- The stream to read fromfieldType- The type of field to compress from FieldConstants.data- The field data- Throws:
IOException
-