mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8305748: Clarify reentrant behavior of close() in FileInputStream, FileOutputStream, and RandomAccessFile
Reviewed-by: alanb, bpb
This commit is contained in:
parent
1bca05eace
commit
0198afca3a
4 changed files with 17 additions and 1 deletions
|
@ -493,6 +493,11 @@ public class FileInputStream extends InputStream
|
|||
* Subclasses requiring that resource cleanup take place after a stream becomes
|
||||
* unreachable should use the {@link java.lang.ref.Cleaner} mechanism.
|
||||
*
|
||||
* <p>
|
||||
* If this stream has an associated channel then this method will close the
|
||||
* channel, which in turn will close this stream. Subclasses that override
|
||||
* this method should be prepared to handle possible reentrant invocation.
|
||||
*
|
||||
* @throws IOException {@inheritDoc}
|
||||
*
|
||||
* @revised 1.4
|
||||
|
|
|
@ -386,6 +386,11 @@ public class FileOutputStream extends OutputStream
|
|||
* Subclasses requiring that resource cleanup take place after a stream becomes
|
||||
* unreachable should use the {@link java.lang.ref.Cleaner} mechanism.
|
||||
*
|
||||
* <p>
|
||||
* If this stream has an associated channel then this method will close the
|
||||
* channel, which in turn will close this stream. Subclasses that override
|
||||
* this method should be prepared to handle possible reentrant invocation.
|
||||
*
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @revised 1.4
|
||||
|
|
|
@ -697,6 +697,11 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
|
|||
* <p> If this file has an associated channel then the channel is closed
|
||||
* as well.
|
||||
*
|
||||
* @apiNote
|
||||
* If this stream has an associated channel then this method will close the
|
||||
* channel, which in turn will close this stream. Subclasses that override
|
||||
* this method should be prepared to handle possible reentrant invocation.
|
||||
*
|
||||
* @throws IOException if an I/O error occurs.
|
||||
*
|
||||
* @revised 1.4
|
||||
|
|
|
@ -122,7 +122,8 @@ import jdk.internal.javac.PreviewFeature;
|
|||
* the originating object, and vice versa. Changing the file's length via the
|
||||
* file channel will change the length seen via the originating object, and vice
|
||||
* versa. Changing the file's content by writing bytes will change the content
|
||||
* seen by the originating object, and vice versa.
|
||||
* seen by the originating object, and vice versa. Closing the channel will
|
||||
* close the originating object.
|
||||
*
|
||||
* <a id="open-mode"></a> <p> At various points this class specifies that an
|
||||
* instance that is "open for reading," "open for writing," or "open for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue