public class ByteBufferQueueInputStream extends InputStream
InputStream backed by a ByteBufferQueue. Assumes that the backing ByteBufferQueue will
not be updated by another thread during calls to read() so all methods are non-blocking and an empty
ByteBufferQueue is deemed equivalent to end of stream.| Constructor and Description |
|---|
ByteBufferQueueInputStream(ByteBufferQueue queue)
Constructs a new instance.
|
ByteBufferQueueInputStream(ByteBufferQueue queue,
int length)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
close, readpublic ByteBufferQueueInputStream(ByteBufferQueue queue)
queue - the backing ByteBufferQueue.public ByteBufferQueueInputStream(ByteBufferQueue queue, int length)
queue - the backing ByteBufferQueue.length - the limit of bytes to take from the backing queue.public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamCopyright © 2004–2017. All rights reserved.