public class StreamReader extends Object
InputStream
and throw an EOFException if the input stream is depleted before the
requested number of bytes is read.| Constructor and Description |
|---|
StreamReader() |
| Modifier and Type | Method and Description |
|---|---|
static byte |
read(InputStream inputStream)
Reads a single byte from the given input stream.
|
static void |
readFully(InputStream inputStream,
byte[] buffer)
Fills the given buffer completely from the given input stream.
|
static void |
readFully(InputStream inputStream,
byte[] buffer,
int position,
int length)
Fills the given part of the buffer from the given input stream.
|
public static byte read(InputStream inputStream) throws IOException
inputStream - The input stream to read fromIOException - if an I/O error occurs or EOF is reachedpublic static void readFully(InputStream inputStream, byte[] buffer) throws IOException
inputStream - The input stream to read frombuffer - The buffer to fillIOException - if an I/O error occurs or EOF is reached before the buffer is
filledpublic static void readFully(InputStream inputStream, byte[] buffer, int position, int length) throws IOException
inputStream - The input stream to read frombuffer - The buffer to fillposition - The position at which to start filling the bufferlength - The number of bytes to readIOException - if an I/O error occurs or EOF is reached before the buffer is
filledCopyright © 2026. All rights reserved.