From 82bf04669fa90728ccae201e145dc941188e1b92 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Fri, 19 Mar 2021 09:40:05 +0000 Subject: Enhance javadoc and coverage for IOUtils git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887801 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/util/IOUtils.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/java/org/apache/poi/util/IOUtils.java') 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 readFully(in, b, 0, b.length) + * + * @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 b 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; -- cgit v1.2.3