Skip to content

Commit

Permalink
Apply auto-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
safris committed Sep 26, 2023
1 parent 9a60594 commit ae8fbe4
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 152 deletions.
38 changes: 19 additions & 19 deletions src/main/java/org/libj/io/DelegateInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class DelegateInputStream extends InputStream {
protected InputStream in;

/**
* Creates a {@link DelegateInputStream} by assigning the argument {@code in} to the field {@code this.in} so as to remember it
* for later use.
* Creates a {@link DelegateInputStream} by assigning the argument {@code in} to the field {@code this.in} so as to remember it for
* later use.
*
* @param in The underlying input stream, or {@code null} if this instance is to be created without an underlying stream.
* @throws NullPointerException If {@code in} is null.
Expand Down Expand Up @@ -66,16 +66,16 @@ public int read() throws IOException {
}

/**
* Reads up to {@code byte.length} bytes of data from this input stream into an array of bytes. This method blocks until some
* input is available.
* Reads up to {@code byte.length} bytes of data from this input stream into an array of bytes. This method blocks until some input
* is available.
* <p>
* This method simply performs the call {@link #read(byte[],int,int) read(b, 0, b.length)} and returns the result. It is important
* that it does <i>not</i> do {@link #read(byte[]) in.read(b)} instead; certain subclasses of {@link DelegateInputStream} depend
* on the implementation strategy actually used.
* that it does <i>not</i> do {@link #read(byte[]) in.read(b)} instead; certain subclasses of {@link DelegateInputStream} depend on
* the implementation strategy actually used.
*
* @param b The buffer into which the data is read.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream
* has been reached.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream has
* been reached.
* @throws IOException If an I/O error has occurred.
* @see DelegateInputStream#read(byte[], int, int)
*/
Expand All @@ -93,8 +93,8 @@ public int read(final byte[] b) throws IOException {
* @param b the buffer into which the data is read.
* @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 {@code -1} if there is no more data because the end of the stream
* has been reached.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream has
* been reached.
* @throws NullPointerException If {@code b} is null.
* @throws IndexOutOfBoundsException If {@code off} is negative, {@code len} is negative, or {@code len} is greater than
* {@code b.length - off}.
Expand Down Expand Up @@ -122,9 +122,9 @@ public long skip(final long n) throws IOException {
}

/**
* Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the
* next caller of a method for this input stream. The next caller might be the same thread or another thread. A single read or
* skip of this many bytes will not block, but may read or skip fewer bytes.
* Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next
* caller of a method for this input stream. The next caller might be the same thread or another thread. A single read or skip of
* this many bytes will not block, but may read or skip fewer bytes.
* <p>
* This method returns the result of {@link #in}.available().
*
Expand All @@ -149,8 +149,8 @@ public void close() throws IOException {
}

/**
* Marks the current position in this input stream. A subsequent call to the {@link #reset()} method repositions this stream at
* the last marked position so that subsequent reads re-read the same bytes.
* Marks the current position in this input stream. A subsequent call to the {@link #reset()} method repositions this stream at the
* last marked position so that subsequent reads re-read the same bytes.
* <p>
* The {@code readlimit} argument tells this input stream to allow that many bytes to be read before the mark position gets
* invalidated.
Expand All @@ -172,10 +172,10 @@ public void mark(final int readlimit) {
* <p>
* This method simply performs {@link #reset() in.reset()}.
* <p>
* Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often
* this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs
* along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within
* readlimit bytes, it allows the outer code to reset the stream and try another parser.
* Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this
* is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along
* happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit
* bytes, it allows the outer code to reset the stream and try another parser.
*
* @throws IOException If the stream has not been marked or if the mark has been invalidated.
* @see DelegateInputStream#in
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/org/libj/io/DelegateReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class DelegateReader extends Reader {
protected Reader in;

/**
* Creates a {@link DelegateReader} by assigning the argument {@code in} to the field {@code this.in} so as to remember it for
* later use.
* Creates a {@link DelegateReader} by assigning the argument {@code in} to the field {@code this.in} so as to remember it for later
* use.
*
* @param in The underlying input stream, or {@code null} if this instance is to be created without an underlying stream.
* @throws NullPointerException If {@code in} is null.
Expand Down Expand Up @@ -121,8 +121,8 @@ public int read(final char[] cbuf, final int off, final int len) throws IOExcept
}

/**
* Attempts to read characters into the specified character buffer. The buffer is used as a repository of characters as-is: the
* only changes made are the results of a put operation. No flipping or rewinding of the buffer is performed.
* Attempts to read characters into the specified character buffer. The buffer is used as a repository of characters as-is: the only
* changes made are the results of a put operation. No flipping or rewinding of the buffer is performed.
* <p>
* This method simply performs {@link #read(CharBuffer) in.readCharBuffer)} and returns the result.
*
Expand Down Expand Up @@ -165,8 +165,8 @@ public void close() throws IOException {
}

/**
* Marks the current position in this input stream. A subsequent call to the {@link #reset()} method repositions this stream at
* the last marked position so that subsequent reads re-read the same bytes.
* Marks the current position in this input stream. A subsequent call to the {@link #reset()} method repositions this stream at the
* last marked position so that subsequent reads re-read the same bytes.
* <p>
* The {@code readlimit} argument tells this input stream to allow that many bytes to be read before the mark position gets
* invalidated.
Expand All @@ -188,10 +188,10 @@ public void mark(final int readlimit) throws IOException {
* <p>
* This method simply performs {@link #reset() in.reset()}.
* <p>
* Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often
* this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs
* along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within
* readlimit bytes, it allows the outer code to reset the stream and try another parser.
* Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this
* is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along
* happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit
* bytes, it allows the outer code to reset the stream and try another parser.
*
* @throws IOException If the stream has not been marked or if the mark has been invalidated.
* @see DelegateReader#in
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/libj/io/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ private static void deleteAll0(final Path path, final Filter<? super Path> filte
}

/**
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the
* {@code filter} will be deleted.
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the {@code filter}
* will be deleted.
*
* @implNote Filtering will be performed at the time the JVM exists (not at the time when this method is called).
* @param path The path to delete recursively.
Expand All @@ -148,8 +148,8 @@ public static void deleteAllOnExit(final Path path, final Filter<? super Path> f
}

/**
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the
* {@code filter} will be deleted.
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the {@code filter}
* will be deleted.
*
* @implNote Filtering will be performed at the time the JVM exists (not at the time when this method is called).
* @param path The path to delete recursively.
Expand All @@ -168,8 +168,8 @@ else if (filter != null && filter.accept(path))
}

/**
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the
* {@code filter} will be deleted.
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the {@code filter}
* will be deleted.
*
* @implNote Filtering will be performed at the time the JVM exists (not at the time when this method is called).
* @param file The file to delete recursively.
Expand All @@ -182,8 +182,8 @@ public static void deleteAllOnExit(final File file, final Filter<? super Path> f
}

/**
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the
* {@code filter} will be deleted.
* Register a path to be recursively deleted when the JVM exits. When executed on exit, only the paths that pass the {@code filter}
* will be deleted.
*
* @implNote Filtering will be performed at the time the JVM exists (not at the time when this method is called).
* @param file The file to delete recursively.
Expand Down Expand Up @@ -261,8 +261,8 @@ public static boolean deleteAll(final Path path) throws IOException {
/**
* Copy a source path to a target path recursively with the {@code options} parameter specifying how the copy is performed. If the
* source path is a directory, this method traverses all child paths, creates child directories, and applies the {@code options}
* parameter to the {@link Files#copy(Path,Path,CopyOption...)} operation applied to each child file. If the source path is a
* file, this method delegate to {@link Files#copy(Path,Path,CopyOption...)}.
* parameter to the {@link Files#copy(Path,Path,CopyOption...)} operation applied to each child file. If the source path is a file,
* this method delegate to {@link Files#copy(Path,Path,CopyOption...)}.
*
* @param source The source path to copy from.
* @param target The target path to copy to.
Expand All @@ -272,8 +272,8 @@ public static boolean deleteAll(final Path path) throws IOException {
* @throws UnsupportedOperationException If the array contains a copy option that is not supported.
* @throws FileAlreadyExistsException If the target file exists but cannot be replaced because the
* {@link StandardCopyOption#REPLACE_EXISTING} option is not specified <i>(optional specific exception)</i>.
* @throws DirectoryNotEmptyException The {@link StandardCopyOption#REPLACE_EXISTING} option is specified but the target path
* could not be deleted <i>(optional specific exception)</i>.
* @throws DirectoryNotEmptyException The {@link StandardCopyOption#REPLACE_EXISTING} option is specified but the target path could
* not be deleted <i>(optional specific exception)</i>.
* @throws SecurityException In the case of the default provider, and a security manager is installed, the
* {@link SecurityManager#checkRead(String) checkRead} method is invoked to check read access to the source file, the
* {@link SecurityManager#checkWrite(String) checkWrite} is invoked to check write access to the target file. If a
Expand Down
18 changes: 8 additions & 10 deletions src/main/java/org/libj/io/ReaderInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ public ReaderInputStream(final Reader reader, final Charset charset, final int b
}

/**
* Construct a new {@link ReaderInputStream} with the specified {@link Reader}, {@link Charset}, and a default input buffer size
* of 1024 characters. Characters from the specified reader that do not map or are invalid to the provided encoder will be
* replaced.
* Construct a new {@link ReaderInputStream} with the specified {@link Reader}, {@link Charset}, and a default input buffer size of
* 1024 characters. Characters from the specified reader that do not map or are invalid to the provided encoder will be replaced.
*
* @param reader The target {@link Reader}.
* @param charset The charset encoding.
Expand All @@ -171,9 +170,8 @@ public ReaderInputStream(final Reader reader, final String charsetName, final in
}

/**
* Construct a new {@link ReaderInputStream} with the specified {@link Reader}, {@link Charset}, and a default input buffer size
* of 1024 characters. Characters from the specified reader that do not map or are invalid to the provided encoder will be
* replaced.
* Construct a new {@link ReaderInputStream} with the specified {@link Reader}, {@link Charset}, and a default input buffer size of
* 1024 characters. Characters from the specified reader that do not map or are invalid to the provided encoder will be replaced.
*
* @param reader The target {@link Reader}.
* @param charsetName The name of the charset encoding.
Expand Down Expand Up @@ -213,8 +211,8 @@ private void fillBuffer() throws IOException {
* @param b The buffer into which the data is read.
* @param off The start offset in array {@code b} at which the data is written.
* @param len The maximum number of bytes to read.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream
* has been reached.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream has
* been reached.
* @throws IOException If an I/O error has occurred.
* @throws NullPointerException If {@code b} is null.
* @throws IndexOutOfBoundsException If {@code off} is negative, {@code len} is negative, or {@code len} is greater than
Expand Down Expand Up @@ -250,8 +248,8 @@ public int read(final byte[] b, int off, int len) throws IOException {
* Read the specified number of bytes into an array.
*
* @param b The buffer into which the data is read.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream
* has been reached.
* @return The total number of bytes read into the buffer, or {@code -1} if there is no more data because the end of the stream has
* been reached.
* @throws IOException If an I/O error has occurred.
* @throws NullPointerException If {@code b} is null.
*/
Expand Down
Loading

0 comments on commit ae8fbe4

Please sign in to comment.