Package io.helidon.common
Class InputStreamHelper
- java.lang.Object
-
- io.helidon.common.InputStreamHelper
-
public abstract class InputStreamHelper extends Object
A set of static utility methods forInputStream
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
readAllBytes(InputStream is)
Reads all remaining bytes from the input stream.This method blocks until all remaining bytes have been read and end of stream is detected, or an exception is thrown.
-
-
-
Method Detail
-
readAllBytes
public static byte[] readAllBytes(InputStream is) throws IOException
Reads all remaining bytes from the input stream.This method blocks until all remaining bytes have been read and end of stream is detected, or an exception is thrown.- Parameters:
is
- theInputStream
to use- Returns:
- a byte array containing the bytes read from this input stream
- Throws:
IOException
- if an I/O error occursOutOfMemoryError
- if an array of the required size cannot be allocated. For example, if an array larger than2GB
would be required to store the bytes.
-
-