public class ChunkedDataInputStream extends MemoryStream
maxBufferSize| Constructor and Description |
|---|
ChunkedDataInputStream(InputStream source,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the MemoryStream for input.
|
protected void |
doGenerateData(Handle h)
This method should be overriden if you are using a separate thread to provide
data, but don't want to use getOutputStream() to write data into the buffer.
|
available, bytesInBuffer, canWrite, flush, generateInputError, getInputStream, getOutputStream, inputWasClosed, noMoreData, pipe, pipe2, read, read, readBlocked, startGeneratingData, waitForDataRequest, waitForDataRequest, writefinalize, hashCode, mark, markSupported, read, reset, skippublic ChunkedDataInputStream(InputStream source, int bufferSize)
public void close()
throws IOException
MemoryStreamclose in class MemoryStreamIOException - If an error occurs, which can only happen
in a subclassprotected void doGenerateData(Handle h)
MemoryStreamThis method should basically loop calling waitForDataRequest(). If waitForDataRequest() returns false this indicates that no more input is needed and the method should exit. Otherwise it should gather data and then call write() to put the data in the buffer.
When there is no more data to write it can then simply exit and the output portion will be closed.
doGenerateData in class MemoryStreamh - a Handle that can be used to stop the doGenerateData(). If shouldStop
is true then the method should exit immediately.