public class BytesInputStream extends InputStream
InputStream view of Bytes. Reading bytes from this stream pushes position of the underlying Bytes. When limit
is reached, BytesInputStream behaves as there is no more input.
This InputStream implementation supports mark(int) and reset()
methods.
BytesInputStream objects are reusable, see bytes(Bytes) method.
BytesCommon.inputStream(),
BytesOutputStream| Constructor and Description |
|---|
BytesInputStream()
Constructs a
BytesInputStream without backing Bytes, bytes(Bytes)
method must be called before first actual use of the constructed BytesInputStream
instance. |
BytesInputStream(Bytes bytes)
Constructs a
BytesInputStream backed by the given bytes. |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
BytesInputStream |
bytes(Bytes bytes)
Reassigns the underlying
Bytes of this input stream. |
void |
close() |
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
readpublic BytesInputStream(Bytes bytes)
BytesInputStream backed by the given bytes.bytes - the Bytes backing the constructed BytesInputStreampublic BytesInputStream()
BytesInputStream without backing Bytes, bytes(Bytes)
method must be called before first actual use of the constructed BytesInputStream
instance.public BytesInputStream bytes(Bytes bytes)
Bytes of this input stream.bytes - new Bytes backing this BytesInputStreamBytesInputStream object backpublic int available()
available in class InputStreampublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic void mark(int readLimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic int read(@NotNull
byte[] b,
int off,
int len)
read in class InputStreampublic void reset()
reset in class InputStreampublic long skip(long n)
skip in class InputStreampublic int read()
read in class InputStreamCopyright © 2019. All rights reserved.