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) |
read
public BytesInputStream(Bytes bytes)
BytesInputStream
backed by the given bytes
.bytes
- the Bytes
backing the constructed BytesInputStream
public 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 BytesInputStream
BytesInputStream
object backpublic int available()
available
in class InputStream
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
public void mark(int readLimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read(@NotNull byte[] b, int off, int len)
read
in class InputStream
public void reset()
reset
in class InputStream
public long skip(long n)
skip
in class InputStream
public int read()
read
in class InputStream
Copyright © 2019. All rights reserved.