public class CompressedGeometryFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
ALPHA_PRESENT_MASK
Bit in compressed geometry data descriptor encoding presence of alphas.
|
private static boolean |
benchmark |
(package private) static int |
BLOCK_HEADER_SIZE
Block header total size in bytes.
|
(package private) int |
bufferNextObjectCount |
(package private) int |
bufferNextObjectOffset |
(package private) int |
bufferObjectCount |
(package private) int |
bufferObjectStart |
(package private) byte[] |
cgBuffer |
(package private) java.io.RandomAccessFile |
cgFile |
(package private) CompressedGeometryData.Header |
cgh |
(package private) static int |
COLOR_PRESENT_MASK
Bit in compressed geometry data descriptor encoding presence of colors.
|
(package private) long[] |
directory |
(package private) static int |
DIRECTORY_OFFSET_OFFSET
Byte offset of the directory offset from start of file.
|
(package private) long |
directoryOffset |
(package private) java.lang.String |
fileName |
(package private) boolean |
fileUpdate |
(package private) static int |
GEOM_DATA_OFFSET
Byte offset of the compressed geometry data descriptor from start of
individual compressed geometry block.
|
(package private) int |
geomDataType |
(package private) int |
geomSize |
(package private) int |
geomStart |
(package private) static int |
HEADER_SIZE
File header total size in bytes.
|
(package private) static int |
MAGIC_NUMBER
The magic number which identifies the compressed geometry file type.
|
(package private) static int |
MAGIC_NUMBER_OFFSET
Byte offset of the magic number from start of file.
|
(package private) int |
magicNumber |
(package private) static int |
MAJOR_VERSION_OFFSET
Byte offset of the major version number from start of file.
|
(package private) int |
majorVersionNumber |
(package private) static int |
MINOR_MINOR_VERSION_OFFSET
Byte offset of the minor minor version number from start of file.
|
(package private) static int |
MINOR_VERSION_OFFSET
Byte offset of the minor version number from start of file.
|
(package private) int |
minorMinorVersionNumber |
(package private) int |
minorVersionNumber |
(package private) static int |
NORMAL_PRESENT_MASK
Bit in compressed geometry data descriptor encoding presence of normals.
|
(package private) static int |
OBJECT_COUNT_OFFSET
Byte offset of the number of objects from start of file.
|
(package private) static int |
OBJECT_SIZE_OFFSET
Byte offset of the object size from start of individual compressed
geometry block.
|
(package private) int |
objectCount |
(package private) int |
objectIndex |
(package private) int[] |
objectSizes |
private static boolean |
print |
(package private) static int |
TYPE_LINE
Value in compressed geometry data descriptor for a line buffer type.
|
(package private) static int |
TYPE_MASK
Bits in compressed geometry data descriptor which encode the buffer type.
|
(package private) static int |
TYPE_POINT
Value in compressed geometry data descriptor for a point buffer type.
|
(package private) static int |
TYPE_TRIANGLE
Value in compressed geometry data descriptor for a triangle buffer type.
|
| Constructor and Description |
|---|
CompressedGeometryFile(java.io.RandomAccessFile file)
Construct a new CompressedGeometryFile instance associated with a
currently open RandomAccessFile.
|
CompressedGeometryFile(java.lang.String file)
Construct a new CompressedGeometryFile instance associated with the
specified file.
|
CompressedGeometryFile(java.lang.String file,
boolean rw)
Construct a new CompressedGeometryFile instance associated with the
specified file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Delete all compressed objects from this instance.
|
void |
close()
Release the resources associated with this instance.
|
protected void |
finalize()
Release file resources when this object is garbage collected.
|
int |
getCurrentIndex()
Return the current object index associated with this instance.
|
java.lang.String |
getFileName()
Return a string containing the file name associated with this instance
or null if there is none.
|
int |
getMajorVersionNumber()
Return the major version number of the most recent compressor used to
compress any of the objects in this instance.
|
int |
getMinorMinorVersionNumber()
Return the subminor version number of the most recent compressor used to
compress any of the objects in this instance.
|
int |
getMinorVersionNumber()
Return the minor version number of the most recent compressor used to
compress any of the objects in this instance.
|
int |
getObjectCount()
Return the number of compressed objects in this instance.
|
(package private) void |
initialize() |
(package private) CompressedGeometryData |
newCG(int geomSize,
int geomStart,
int geomDataType) |
(package private) void |
open(java.lang.String fname,
boolean rw) |
CompressedGeometryData[] |
read()
Read all compressed geometry objects contained in the instance.
|
CompressedGeometryData |
read(int index)
Read the compressed geometry object at the specified index.
|
(package private) void |
readDirectory(long offset,
long[] directory) |
(package private) void |
readFileHeader() |
CompressedGeometryData |
readNext()
Read the next compressed geometry object in the instance.
|
(package private) CompressedGeometryData |
readNext(int bufferReadLimit) |
(package private) void |
setFilePointer(long offset) |
void |
write(CompressedGeometryData.Header cgh,
byte[] geometry)
Add a buffer of compressed geometry data to the end of the
resource.
|
void |
write(CompressedGeometryData cg)
Add a compressed geometry node component to the end of the instance.
|
(package private) void |
writeFileDirectory() |
(package private) void |
writeFileHeader() |
private static final boolean print
private static final boolean benchmark
static final int MAGIC_NUMBER
static final int MAGIC_NUMBER_OFFSET
static final int MAJOR_VERSION_OFFSET
static final int MINOR_VERSION_OFFSET
static final int MINOR_MINOR_VERSION_OFFSET
static final int OBJECT_COUNT_OFFSET
static final int DIRECTORY_OFFSET_OFFSET
static final int HEADER_SIZE
static final int OBJECT_SIZE_OFFSET
static final int GEOM_DATA_OFFSET
static final int TYPE_MASK
static final int NORMAL_PRESENT_MASK
static final int COLOR_PRESENT_MASK
static final int ALPHA_PRESENT_MASK
static final int TYPE_POINT
static final int TYPE_LINE
static final int TYPE_TRIANGLE
static final int BLOCK_HEADER_SIZE
java.lang.String fileName
int majorVersionNumber
int minorVersionNumber
int minorMinorVersionNumber
int objectCount
int objectIndex
java.io.RandomAccessFile cgFile
int magicNumber
byte[] cgBuffer
int geomSize
int geomStart
int geomDataType
long[] directory
long directoryOffset
int[] objectSizes
int bufferObjectStart
int bufferObjectCount
int bufferNextObjectCount
int bufferNextObjectOffset
CompressedGeometryData.Header cgh
boolean fileUpdate
public CompressedGeometryFile(java.lang.String file)
throws java.io.IOException
file - path to the compressed geometry resource filejava.io.FileNotFoundException - if file doesn't exist or
cannot be readjava.lang.IllegalArgumentException - if the file is not a compressed
geometry resource filejava.io.IOException - if there is a header or directory read errorpublic CompressedGeometryFile(java.lang.String file,
boolean rw)
throws java.io.IOException
file - path to the compressed geometry resource filerw - if true, opens the file for read and write access or attempts
to create one if it doesn't exist; if false, opens the file with
read-only accessjava.io.FileNotFoundException - if file doesn't exist or
access permissions disallow accessjava.lang.IllegalArgumentException - if the file is not a compressed
geometry resource filejava.io.IOException - if there is a header or directory read errorpublic CompressedGeometryFile(java.io.RandomAccessFile file)
throws java.io.IOException
file - currently open RandomAccessFilejava.lang.IllegalArgumentException - if the file is not a compressed
geometry resource filejava.io.IOException - if there is a header or directory read errorpublic void clear()
throws java.io.IOException
java.io.IOException - if clear failspublic java.lang.String getFileName()
public int getMajorVersionNumber()
public int getMinorVersionNumber()
public int getMinorMinorVersionNumber()
public int getObjectCount()
public int getCurrentIndex()
public CompressedGeometryData readNext() throws java.io.IOException
java.io.IOException - if read failspublic CompressedGeometryData[] read() throws java.io.IOException
java.io.IOException - if read failspublic CompressedGeometryData read(int index) throws java.io.IOException
index - compressed geometry object to readjava.lang.IndexOutOfBoundsException - if object index is
out of rangejava.io.IOException - if read failspublic void write(CompressedGeometryData cg) throws java.io.IOException
cg - a compressed geometry node componentCapabilityNotSetException - if unable to get compressed
geometry data from the node componentjava.io.IOException - if write failspublic void write(CompressedGeometryData.Header cgh, byte[] geometry) throws java.io.IOException
cgh - a CompressedGeometryData.Header object describing the data.geometry - the compressed geometry datajava.io.IOException - if write failspublic void close()
void open(java.lang.String fname,
boolean rw)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundExceptionjava.io.IOExceptionvoid setFilePointer(long offset)
throws java.io.IOException
java.io.IOExceptionvoid initialize()
throws java.io.IOException
java.io.IOExceptionvoid readFileHeader()
throws java.io.IOException
java.io.IOExceptionvoid writeFileHeader()
throws java.io.IOException
java.io.IOExceptionvoid readDirectory(long offset,
long[] directory)
throws java.io.IOException
java.io.IOExceptionvoid writeFileDirectory()
throws java.io.IOException
java.io.IOExceptionCompressedGeometryData readNext(int bufferReadLimit) throws java.io.IOException
java.io.IOExceptionCompressedGeometryData newCG(int geomSize, int geomStart, int geomDataType)
protected void finalize()
finalize in class java.lang.ObjectCopyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.