public class FastByteBufferQueueInputStream extends InputStream
InputStream backed by a set number of bytes from the head of a ByteBufferQueue.
Assumes that the backing ByteBufferQueue will not be read by another thread during calls to read()
so all methods are non-blocking. Does not support mark(int).| Constructor and Description |
|---|
FastByteBufferQueueInputStream(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 FastByteBufferQueueInputStream(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.