diff -r a7f16447085e -r 48e480e56aad src/java.base/share/classes/java/io/FileInputStream.java
--- a/src/java.base/share/classes/java/io/FileInputStream.java Tue Sep 24 10:04:13 2019 +0000
+++ b/src/java.base/share/classes/java/io/FileInputStream.java Tue Sep 24 09:43:43 2019 +0100
@@ -30,13 +30,13 @@
/**
- * A FileInputStream
obtains input bytes
+ * A {@code FileInputStream} obtains input bytes
* from a file in a file system. What files
* are available depends on the host environment.
*
- *
FileInputStream
is meant for reading streams of raw bytes
+ *
{@code FileInputStream} is meant for reading streams of raw bytes
* such as image data. For reading streams of characters, consider using
- * FileReader
.
+ * {@code FileReader}.
*
* @apiNote
* To release resources used by this stream {@link #close} should be called
@@ -80,21 +80,21 @@
private volatile boolean closed;
/**
- * Creates a FileInputStream
by
+ * Creates a {@code FileInputStream} by
* opening a connection to an actual file,
- * the file named by the path name name
- * in the file system. A new FileDescriptor
+ * the file named by the path name {@code name}
+ * in the file system. A new {@code FileDescriptor}
* object is created to represent this file
* connection.
*
* First, if there is a security
- * manager, its checkRead
method
- * is called with the name
argument
+ * manager, its {@code checkRead} method
+ * is called with the {@code name} argument
* as its argument.
*
* If the named file does not exist, is a directory rather than a regular
* file, or for some other reason cannot be opened for reading then a
- * FileNotFoundException
is thrown.
+ * {@code FileNotFoundException} is thrown.
*
* @param name the system-dependent file name.
* @throws FileNotFoundException if the file does not exist,
@@ -102,7 +102,7 @@
* or for some other reason cannot be opened for
* reading.
* @throws SecurityException if a security manager exists and its
- * checkRead
method denies read access
+ * {@code checkRead} method denies read access
* to the file.
* @see java.lang.SecurityManager#checkRead(java.lang.String)
*/
@@ -111,21 +111,21 @@
}
/**
- * Creates a FileInputStream
by
+ * Creates a {@code FileInputStream} by
* opening a connection to an actual file,
- * the file named by the File
- * object file
in the file system.
- * A new FileDescriptor
object
+ * the file named by the {@code File}
+ * object {@code file} in the file system.
+ * A new {@code FileDescriptor} object
* is created to represent this file connection.
*
* First, if there is a security manager,
- * its checkRead
method is called
- * with the path represented by the file
+ * its {@code checkRead} method is called
+ * with the path represented by the {@code file}
* argument as its argument.
*
* If the named file does not exist, is a directory rather than a regular
* file, or for some other reason cannot be opened for reading then a
- * FileNotFoundException
is thrown.
+ * {@code FileNotFoundException} is thrown.
*
* @param file the file to be opened for reading.
* @throws FileNotFoundException if the file does not exist,
@@ -133,7 +133,7 @@
* or for some other reason cannot be opened for
* reading.
* @throws SecurityException if a security manager exists and its
- * checkRead
method denies read access to the file.
+ * {@code checkRead} method denies read access to the file.
* @see java.io.File#getPath()
* @see java.lang.SecurityManager#checkRead(java.lang.String)
*/
@@ -157,26 +157,26 @@
}
/**
- * Creates a FileInputStream
by using the file descriptor
- * fdObj
, which represents an existing connection to an
+ * Creates a {@code FileInputStream} by using the file descriptor
+ * {@code fdObj}, which represents an existing connection to an
* actual file in the file system.
*
- * If there is a security manager, its checkRead
method is
- * called with the file descriptor fdObj
as its argument to
+ * If there is a security manager, its {@code checkRead} method is
+ * called with the file descriptor {@code fdObj} as its argument to
* see if it's ok to read the file descriptor. If read access is denied
- * to the file descriptor a SecurityException
is thrown.
+ * to the file descriptor a {@code SecurityException} is thrown.
*
- * If fdObj
is null then a NullPointerException
+ * If {@code fdObj} is null then a {@code NullPointerException}
* is thrown.
*
- * This constructor does not throw an exception if fdObj
+ * This constructor does not throw an exception if {@code fdObj}
* is {@link java.io.FileDescriptor#valid() invalid}.
* However, if the methods are invoked on the resulting stream to attempt
- * I/O on the stream, an IOException
is thrown.
+ * I/O on the stream, an {@code IOException} is thrown.
*
* @param fdObj the file descriptor to be opened for reading.
* @throws SecurityException if a security manager exists and its
- * checkRead
method denies read access to the
+ * {@code checkRead} method denies read access to the
* file descriptor.
* @see SecurityManager#checkRead(java.io.FileDescriptor)
*/
@@ -217,7 +217,7 @@
* Reads a byte of data from this input stream. This method blocks
* if no input is yet available.
*
- * @return the next byte of data, or -1
if the end of the
+ * @return the next byte of data, or {@code -1} if the end of the
* file is reached.
* @throws IOException if an I/O error occurs.
*/
@@ -237,13 +237,13 @@
private native int readBytes(byte b[], int off, int len) throws IOException;
/**
- * Reads up to b.length
bytes of data from this input
+ * Reads up to {@code b.length} bytes of data from this input
* stream into an array of bytes. This method blocks until some input
* is available.
*
* @param b the buffer into which the data is read.
* @return the total number of bytes read into the buffer, or
- * -1
if there is no more data because the end of
+ * {@code -1} if there is no more data because the end of
* the file has been reached.
* @throws IOException if an I/O error occurs.
*/
@@ -252,21 +252,21 @@
}
/**
- * Reads up to len
bytes of data from this input stream
- * into an array of bytes. If len
is not zero, the method
+ * Reads up to {@code len} bytes of data from this input stream
+ * into an array of bytes. If {@code len} is not zero, the method
* blocks until some input is available; otherwise, no
- * bytes are read and 0
is returned.
+ * bytes are read and {@code 0} is returned.
*
* @param b the buffer into which the data is read.
- * @param off the start offset in the destination array b
+ * @param off the start offset in the destination array {@code b}
* @param len the maximum number of bytes read.
* @return the total number of bytes read into the buffer, or
- * -1
if there is no more data because the end of
+ * {@code -1} if there is no more data because the end of
* the file has been reached.
- * @throws NullPointerException If b
is null
.
- * @throws IndexOutOfBoundsException If off
is negative,
- * len
is negative, or len
is greater than
- * b.length - off
+ * @throws NullPointerException If {@code b} is {@code null}.
+ * @throws IndexOutOfBoundsException If {@code off} is negative,
+ * {@code len} is negative, or {@code len} is greater than
+ * {@code b.length - off}
* @throws IOException if an I/O error occurs.
*/
public int read(byte b[], int off, int len) throws IOException {
@@ -274,14 +274,14 @@
}
/**
- * Skips over and discards n
bytes of data from the
+ * Skips over and discards {@code n} bytes of data from the
* input stream.
*
- *
The skip
method may, for a variety of
+ *
The {@code skip} method may, for a variety of
* reasons, end up skipping over some smaller number of bytes,
- * possibly 0
. If n
is negative, the method
+ * possibly {@code 0}. If {@code n} is negative, the method
* will try to skip backwards. In case the backing file does not support
- * backward skip at its current position, an IOException
is
+ * backward skip at its current position, an {@code IOException} is
* thrown. The actual number of bytes skipped is returned. If it skips
* forwards, it returns a positive value. If it skips backwards, it
* returns a negative value.
@@ -372,10 +372,10 @@
}
/**
- * Returns the FileDescriptor
+ * Returns the {@code FileDescriptor}
* object that represents the connection to
* the actual file in the file system being
- * used by this FileInputStream
.
+ * used by this {@code FileInputStream}.
*
* @return the file descriptor object associated with this stream.
* @throws IOException if an I/O error occurs.