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.InterruptedExceptionpublic void doneStuffingQueue()
public void stuffQueue()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readLimit)
mark in class java.io.InputStreampublic void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreampublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException