@NotThreadSafe public final class ByteBuffersInputStream extends InputStream
InputStream wrapped around one or more
ByteBuffer objects.| Constructor and Description |
|---|
ByteBuffersInputStream(ByteBuffer... aBuffers)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
ByteBuffer[] |
getAllBuffers() |
long |
getAvailable() |
boolean |
isAnythingAvailable() |
boolean |
isClosed() |
void |
mark(int nReadlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] aBuf) |
int |
read(byte[] aBuf,
int nOfs,
int nLen) |
long |
read(ByteBuffer aDestByteBuffer)
Reads as much as possible into the destination buffer.
|
void |
reset() |
long |
skip(long nBytesToSkip) |
public ByteBuffersInputStream(@Nonnull @Nonempty ByteBuffer... aBuffers)
aBuffers - Array of ByteBuffer. May neither be null nor
empty and may not contain null elements.public boolean isClosed()
@Nonnull @ReturnsMutableCopy public ByteBuffer[] getAllBuffers()
null.public boolean isAnythingAvailable()
true if any byte buffer has at least one byte left.@Nonnegative public long getAvailable()
@Nonnegative public int available()
available in class InputStreampublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class InputStreampublic void mark(int nReadlimit)
mark in class InputStreampublic void reset()
reset in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic int read()
read in class InputStreampublic int read(@Nonnull byte[] aBuf)
read in class InputStreampublic int read(@Nonnull byte[] aBuf, @Nonnegative int nOfs, @Nonnegative int nLen)
read in class InputStream@Nonnegative public long skip(long nBytesToSkip)
skip in class InputStream@Nonnegative public long read(@Nonnull ByteBuffer aDestByteBuffer)
aDestByteBuffer - The destination byte buffer to use. May not be null.Copyright © 2014–2016 Philip Helger. All rights reserved.