public class XThreadInputStream extends InputStream
Constructor and Description |
---|
XThreadInputStream()
Constructor, from another source.
|
XThreadInputStream(InputStream sourceStream)
Constructor, from a given input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Call this method to abort the stuffQueue() method.
|
int |
available()
Get available.
|
void |
close()
Close.
|
void |
doneStuffingQueue()
Call this method when there is no more data to write.
|
void |
mark(int readLimit)
Mark.
|
boolean |
markSupported()
Check if mark is supported.
|
int |
read()
Read a byte.
|
int |
read(byte[] b)
Read lots of bytes.
|
int |
read(byte[] b,
int off,
int len)
Read lots of specific bytes.
|
void |
reset()
Reset.
|
long |
skip(long n)
Skip
|
void |
stuffQueue()
This method is called from the helper thread side, to keep the queue
stuffed from the input stream.
|
void |
stuffQueue(byte[] byteBuffer,
int offset,
int amount)
This method is called from the helper thread side, to stuff bytes onto
the queue when there is no input stream.
|
public XThreadInputStream(InputStream sourceStream)
public XThreadInputStream()
public void abort()
public void stuffQueue(byte[] byteBuffer, int offset, int amount) throws InterruptedException
InterruptedException
public void doneStuffingQueue()
public void stuffQueue() throws IOException, InterruptedException
IOException
InterruptedException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void mark(int readLimit)
mark
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
public boolean markSupported()
markSupported
in class InputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException