diff options
author | Dominik Stadler <centic@apache.org> | 2021-03-19 09:40:05 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2021-03-19 09:40:05 +0000 |
commit | 82bf04669fa90728ccae201e145dc941188e1b92 (patch) | |
tree | 225c2767bffd7a2d8d752ff3d15bc20344138040 /src/java/org/apache/poi/util/IOUtils.java | |
parent | 2ceb5ff55346ee97c3541c9e7bcd8bc5847be9b4 (diff) | |
download | poi-82bf04669fa90728ccae201e145dc941188e1b92.tar.gz poi-82bf04669fa90728ccae201e145dc941188e1b92.zip |
Enhance javadoc and coverage for IOUtils
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/util/IOUtils.java')
-rw-r--r-- | src/java/org/apache/poi/util/IOUtils.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/util/IOUtils.java b/src/java/org/apache/poi/util/IOUtils.java index 8e69427553..974efdf64b 100644 --- a/src/java/org/apache/poi/util/IOUtils.java +++ b/src/java/org/apache/poi/util/IOUtils.java @@ -232,6 +232,13 @@ public final class IOUtils { /** * Helper method, just calls <tt>readFully(in, b, 0, b.length)</tt> + * + * @param in the stream from which the data is read. + * @param b the buffer into which the data is read. + * + * @return the number of bytes read or -1 if no bytes were read + * + * @throws IOException if reading from the stream fails */ public static int readFully(InputStream in, byte[] b) throws IOException { return readFully(in, b, 0, b.length); @@ -250,6 +257,10 @@ public final class IOUtils { * @param b the buffer into which the data is read. * @param off the start offset in array <tt>b</tt> at which the data is written. * @param len the maximum number of bytes to read. + * + * @return the number of bytes read or -1 if no bytes were read + * + * @throws IOException if reading from the stream fails */ public static int readFully(InputStream in, byte[] b, int off, int len) throws IOException { int total = 0; @@ -275,6 +286,13 @@ public final class IOUtils { * number of bytes read. If the end of the file isn't reached before the * buffer has no more remaining capacity, will return the number of bytes * that were read. + * + * @param channel The byte-channel to read data from + * @param b the buffer into which the data is read. + * + * @return the number of bytes read or -1 if no bytes were read + * + * @throws IOException if reading from the stream fails */ public static int readFully(ReadableByteChannel channel, ByteBuffer b) throws IOException { int total = 0; |