📄 compressedgeometryfile.html
字号:
CompressedGeometryFile</H3><PRE>public <B>CompressedGeometryFile</B>(java.io.RandomAccessFile file) throws java.io.IOException</PRE><DL><DD>Construct a new CompressedGeometryFile instance associated with a currently open RandomAccessFile.<P><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - currently open RandomAccessFile<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the file is not a compressed geometry resource file<DD><CODE>java.io.IOException</CODE> - if there is a header or directory read error</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>() throws java.io.IOException</PRE><DL><DD>Delete all compressed objects from this instance. This method may only be called after successfully creating a CompressedGeometryFile instance with read-write access, so a corrupted or otherwise invalid resource must be removed manually before it can be rewritten. The close() method must be called sometime after invoking clear() in order to write out the new directory structure.<P><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if clear fails</DL></DD></DL><HR><A NAME="getFileName()"><!-- --></A><H3>getFileName</H3><PRE>public java.lang.String <B>getFileName</B>()</PRE><DL><DD>Return a string containing the file name associated with this instance or null if there is none.<P><DD><DL><DT><B>Returns:</B><DD>file name associated with this instance or null if there is none</DL></DD></DL><HR><A NAME="getMajorVersionNumber()"><!-- --></A><H3>getMajorVersionNumber</H3><PRE>public int <B>getMajorVersionNumber</B>()</PRE><DL><DD>Return the major version number of the most recent compressor used to compress any of the objects in this instance.<P><DD><DL><DT><B>Returns:</B><DD>major version number</DL></DD></DL><HR><A NAME="getMinorVersionNumber()"><!-- --></A><H3>getMinorVersionNumber</H3><PRE>public int <B>getMinorVersionNumber</B>()</PRE><DL><DD>Return the minor version number of the most recent compressor used to compress any of the objects in this instance.<P><DD><DL><DT><B>Returns:</B><DD>minor version number</DL></DD></DL><HR><A NAME="getMinorMinorVersionNumber()"><!-- --></A><H3>getMinorMinorVersionNumber</H3><PRE>public int <B>getMinorMinorVersionNumber</B>()</PRE><DL><DD>Return the subminor version number of the most recent compressor used to compress any of the objects in this instance.<P><DD><DL><DT><B>Returns:</B><DD>subminor version number</DL></DD></DL><HR><A NAME="getObjectCount()"><!-- --></A><H3>getObjectCount</H3><PRE>public int <B>getObjectCount</B>()</PRE><DL><DD>Return the number of compressed objects in this instance.<P><DD><DL><DT><B>Returns:</B><DD>number of compressed objects</DL></DD></DL><HR><A NAME="getCurrentIndex()"><!-- --></A><H3>getCurrentIndex</H3><PRE>public int <B>getCurrentIndex</B>()</PRE><DL><DD>Return the current object index associated with this instance. This is the index of the object that would be returned by an immediately following call to the readNext() method. Its initial value is 0; -1 is returned if the last object has been read.<P><DD><DL><DT><B>Returns:</B><DD>current object index, or -1 if at end</DL></DD></DL><HR><A NAME="readNext()"><!-- --></A><H3>readNext</H3><PRE>public <A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.html" title="class in com.sun.j3d.utils.geometry.compression">CompressedGeometryData</A> <B>readNext</B>() throws java.io.IOException</PRE><DL><DD>Read the next compressed geometry object in the instance. This is initially the first object (index 0) in the instance; otherwise, it is whatever object is next after the last one read. The current object index is incremented by 1 after the read. When the last object is read the index becomes invalid and an immediately subsequent call to readNext() returns null.<P><DD><DL><DT><B>Returns:</B><DD>a CompressedGeometryData node component, or null if the last object has been read<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if read fails</DL></DD></DL><HR><A NAME="read()"><!-- --></A><H3>read</H3><PRE>public <A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.html" title="class in com.sun.j3d.utils.geometry.compression">CompressedGeometryData</A>[] <B>read</B>() throws java.io.IOException</PRE><DL><DD>Read all compressed geometry objects contained in the instance. The current object index becomes invalid; an immediately following call to readNext() will return null.<P><DD><DL><DT><B>Returns:</B><DD>an array of CompressedGeometryData node components.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if read fails</DL></DD></DL><HR><A NAME="read(int)"><!-- --></A><H3>read</H3><PRE>public <A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.html" title="class in com.sun.j3d.utils.geometry.compression">CompressedGeometryData</A> <B>read</B>(int index) throws java.io.IOException</PRE><DL><DD>Read the compressed geometry object at the specified index. The current object index is set to the subsequent object unless the last object has been read, in which case the index becomes invalid and an immediately following call to readNext() will return null.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - compressed geometry object to read<DT><B>Returns:</B><DD>a CompressedGeometryData node component<DT><B>Throws:</B><DD><CODE>java.lang.IndexOutOfBoundsException</CODE> - if object index is out of range<DD><CODE>java.io.IOException</CODE> - if read fails</DL></DD></DL><HR><A NAME="write(com.sun.j3d.utils.geometry.compression.CompressedGeometryData)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(<A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.html" title="class in com.sun.j3d.utils.geometry.compression">CompressedGeometryData</A> cg) throws java.io.IOException</PRE><DL><DD>Add a compressed geometry node component to the end of the instance. The current object index becomes invalid; an immediately following call to readNext() will return null. The close() method must be called at some later time in order to create a valid compressed geometry file.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>cg</CODE> - a compressed geometry node component<DT><B>Throws:</B><DD><CODE>CapabilityNotSetException</CODE> - if unable to get compressed geometry data from the node component<DD><CODE>java.io.IOException</CODE> - if write fails</DL></DD></DL><HR><A NAME="write(com.sun.j3d.utils.geometry.compression.CompressedGeometryData.Header, byte[])"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(<A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.Header.html" title="class in com.sun.j3d.utils.geometry.compression">CompressedGeometryData.Header</A> cgh, byte[] geometry) throws java.io.IOException</PRE><DL><DD>Add a buffer of compressed geometry data to the end of the resource. The current object index becomes invalid; an immediately following call to readNext() will return null. The close() method must be called at some later time in order to create a valid compressed geometry file.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>cgh</CODE> - a CompressedGeometryData.Header object describing the data.<DD><CODE>geometry</CODE> - the compressed geometry data<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if write fails</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD>Release the resources associated with this instance. Write out final header and directory if contents were updated. This method must be called in order to create a valid compressed geometry resource file if any updates were made.<P><DD><DL></DL></DD></DL><HR><A NAME="finalize()"><!-- --></A><H3>finalize</H3><PRE>protected void <B>finalize</B>()</PRE><DL><DD>Release file resources when this object is garbage collected.<P><DD><DL><DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressedGeometryData.Header.html" title="class in com.sun.j3d.utils.geometry.compression"><B>PREV CLASS</B></A> <A HREF="../../../../../../com/sun/j3d/utils/geometry/compression/CompressionStream.html" title="class in com.sun.j3d.utils.geometry.compression"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/sun/j3d/utils/geometry/compression/CompressedGeometryFile.html" target="_top"><B>FRAMES</B></A> <A HREF="CompressedGeometryFile.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1">Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../../../../LICENSE-SPEC.html">license terms</a>.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -