public class XThreadInputStream
extends java.io.InputStream
Constructor and Description |
---|
XThreadInputStream()
Constructor, from another source.
|
XThreadInputStream(java.io.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(java.io.InputStream sourceStream)
public XThreadInputStream()
public void abort()
public void stuffQueue(byte[] byteBuffer, int offset, int amount) throws java.lang.InterruptedException
java.lang.InterruptedException
public void doneStuffingQueue()
public void stuffQueue() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void mark(int readLimit)
mark
in class java.io.InputStream
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException