Package io.bytestreams.codec.core.util
Class InputStreams
java.lang.Object
io.bytestreams.codec.core.util.InputStreams
Utility methods for working with input streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]readFully(InputStream input, int length) Reads exactly the specified number of bytes from the input stream.
-
Method Details
-
readFully
Reads exactly the specified number of bytes from the input stream.- Parameters:
input- the input stream to read fromlength- the exact number of bytes to read- Returns:
- a byte array containing the bytes read
- Throws:
IllegalArgumentException- if length is negativeIOException- if an I/O error occursEOFException- if the stream ends before the required bytes are read
-