Xj3D VRML/X3D Code API

org.web3d.vrml.export.compressors
Class RangeCompressor

java.lang.Object
  extended byorg.web3d.vrml.export.compressors.BinaryFieldEncoder
      extended byorg.web3d.vrml.export.compressors.RangeCompressor
All Implemented Interfaces:
FieldCompressor, FieldDecompressor

public class RangeCompressor
extends BinaryFieldEncoder

A FieldCompressor that works by compressing the range of data. Floats are converted to ints before range compression.

Version:
$Revision: 1.4 $
Author:
Alan Hudson

Constructor Summary
RangeCompressor()
           
 
Method Summary
 void compress(java.io.DataOutputStream dos, int fieldType, float[] data)
          Compress this field and deposit the output to the bitstream
 void compress(java.io.DataOutputStream dos, int fieldType, int[] data)
          Compress this field and deposit the output to the bitstream
 
Methods inherited from class org.web3d.vrml.export.compressors.BinaryFieldEncoder
canSupport, compress, compress, compress, compress, compress, compress, compress, compress, compress, compress, compress, compress, decompressBoolean, decompressBoolean, decompressDouble, decompressDouble, decompressDouble, decompressFloat, decompressFloat, decompressFloat, decompressInt, decompressInt, decompressLong, decompressLong, decompressString, decompressString, nextLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeCompressor

public RangeCompressor()
Method Detail

compress

public void compress(java.io.DataOutputStream dos,
                     int fieldType,
                     int[] data)
              throws java.io.IOException
Compress this field and deposit the output to the bitstream

Specified by:
compress in interface FieldCompressor
Overrides:
compress in class BinaryFieldEncoder
Parameters:
dos - The stream to output the result
fieldType - The type of field to compress from FieldConstants.
data - The field data
Throws:
java.io.IOException

compress

public void compress(java.io.DataOutputStream dos,
                     int fieldType,
                     float[] data)
              throws java.io.IOException
Compress this field and deposit the output to the bitstream

Specified by:
compress in interface FieldCompressor
Overrides:
compress in class BinaryFieldEncoder
Parameters:
dos - The stream to output the result
fieldType - The type of field to compress from FieldConstants.
data - The field data
Throws:
java.io.IOException

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium