< prev index next >

src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java

Print this page

139 
140     public void seek(long pos) throws IOException {
141         checkClosed();
142         if (pos < flushedPos) {
143             throw new IndexOutOfBoundsException("pos < flushedPos!");
144         }
145         bitOffset = 0;
146         raf.seek(pos);
147         streamPos = raf.getFilePointer();
148     }
149 
150     public void close() throws IOException {
151         super.close();
152         disposerRecord.dispose(); // this closes the RandomAccessFile
153         raf = null;
154     }
155 
156     /**
157      * {@inheritDoc}
158      *
159      * @deprecated The {@code finalize} method has been deprecated.
160      *     Subclasses that override {@code finalize} in order to perform cleanup
161      *     should be modified to use alternative cleanup mechanisms and
162      *     to remove the overriding {@code finalize} method.
163      *     When overriding the {@code finalize} method, its implementation must explicitly
164      *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
165      *     See the specification for {@link Object#finalize()} for further
166      *     information about migration options.
167      */
168     @Deprecated(since="9")

169     protected void finalize() throws Throwable {
170         // Empty finalizer: for performance reasons we instead use the
171         // Disposer mechanism for ensuring that the underlying
172         // RandomAccessFile is closed prior to garbage collection
173     }
174 }

139 
140     public void seek(long pos) throws IOException {
141         checkClosed();
142         if (pos < flushedPos) {
143             throw new IndexOutOfBoundsException("pos < flushedPos!");
144         }
145         bitOffset = 0;
146         raf.seek(pos);
147         streamPos = raf.getFilePointer();
148     }
149 
150     public void close() throws IOException {
151         super.close();
152         disposerRecord.dispose(); // this closes the RandomAccessFile
153         raf = null;
154     }
155 
156     /**
157      * {@inheritDoc}
158      *
159      * @deprecated Finalization has been deprecated for removal.  See
160      * {@link java.lang.Object#finalize} for background information and details
161      * about migration options.





162      */
163     @Deprecated(since="9", forRemoval=true)
164     @SuppressWarnings("removal")
165     protected void finalize() throws Throwable {
166         // Empty finalizer: for performance reasons we instead use the
167         // Disposer mechanism for ensuring that the underlying
168         // RandomAccessFile is closed prior to garbage collection
169     }
170 }
< prev index next >