From 6e67a7b54af82aa4e4ec28f50ff08a26f9d80627 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 4 May 2023 00:49:57 +0200 Subject: IOUtil.copyStream2Byte{Array|Buffer}(..): API Doc: Clarify that the complete stream is copied. --- src/java/com/jogamp/common/util/IOUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/java/com') diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java index 32e7505..499fa1b 100644 --- a/src/java/com/jogamp/common/util/IOUtil.java +++ b/src/java/com/jogamp/common/util/IOUtil.java @@ -257,7 +257,7 @@ public class IOUtil { } /** - * Copy the specified input stream to a byte array, which is being returned. + * Copy the complete specified input stream to a byte array, which is being returned. */ public static byte[] copyStream2ByteArray(InputStream stream) throws IOException { if( !(stream instanceof BufferedInputStream) ) { @@ -290,8 +290,7 @@ public class IOUtil { } /** - * Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned. - *

The implementation creates the ByteBuffer w/ {@link #copyStream2ByteArray(InputStream)}'s returned byte array.

+ * Copy the complete specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned. * * @param stream input stream, which will be wrapped into a BufferedInputStream, if not already done. */ @@ -300,11 +299,10 @@ public class IOUtil { } /** - * Copy the specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned. - *

The implementation creates the ByteBuffer w/ {@link #copyStream2ByteArray(InputStream)}'s returned byte array.

+ * Copy the complete specified input stream to a NIO ByteBuffer w/ native byte order, which is being returned. * * @param stream input stream, which will be wrapped into a BufferedInputStream, if not already done. - * @param initialCapacity initial buffer capacity in bytes, if > available bytes + * @param initialCapacity initial buffer capacity in bytes, if < currently available bytes, initial buffer capacity is set to currently available bytes. */ public static ByteBuffer copyStream2ByteBuffer(InputStream stream, int initialCapacity) throws IOException { if( !(stream instanceof BufferedInputStream) ) { -- cgit v1.2.3