147 */
148 public void seek(long pos) throws IOException {
149 checkClosed();
150 if (pos < flushedPos) {
151 throw new IndexOutOfBoundsException("pos < flushedPos!");
152 }
153 bitOffset = 0;
154 raf.seek(pos);
155 streamPos = raf.getFilePointer();
156 }
157
158 public void close() throws IOException {
159 super.close();
160 disposerRecord.dispose(); // this closes the RandomAccessFile
161 raf = null;
162 }
163
164 /**
165 * {@inheritDoc}
166 *
167 * @deprecated The {@code finalize} method has been deprecated.
168 * Subclasses that override {@code finalize} in order to perform cleanup
169 * should be modified to use alternative cleanup mechanisms and
170 * to remove the overriding {@code finalize} method.
171 * When overriding the {@code finalize} method, its implementation must explicitly
172 * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
173 * See the specification for {@link Object#finalize()} for further
174 * information about migration options.
175 */
176 @Deprecated(since="9")
177 protected void finalize() throws Throwable {
178 // Empty finalizer: for performance reasons we instead use the
179 // Disposer mechanism for ensuring that the underlying
180 // RandomAccessFile is closed prior to garbage collection
181 }
182 }
|
147 */
148 public void seek(long pos) throws IOException {
149 checkClosed();
150 if (pos < flushedPos) {
151 throw new IndexOutOfBoundsException("pos < flushedPos!");
152 }
153 bitOffset = 0;
154 raf.seek(pos);
155 streamPos = raf.getFilePointer();
156 }
157
158 public void close() throws IOException {
159 super.close();
160 disposerRecord.dispose(); // this closes the RandomAccessFile
161 raf = null;
162 }
163
164 /**
165 * {@inheritDoc}
166 *
167 * @deprecated Finalization has been deprecated for removal. See
168 * {@link java.lang.Object#finalize} for background information and details
169 * about migration options.
170 */
171 @Deprecated(since="9", forRemoval=true)
172 @SuppressWarnings("removal")
173 protected void finalize() throws Throwable {
174 // Empty finalizer: for performance reasons we instead use the
175 // Disposer mechanism for ensuring that the underlying
176 // RandomAccessFile is closed prior to garbage collection
177 }
178 }
|