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, write
finalize, hashCode, mark, markSupported, read, reset, skip
public ChunkedDataInputStream(InputStream source, int bufferSize)
public void close() throws IOException
MemoryStream
close
in class MemoryStream
IOException
- If an error occurs, which can only happen
in a subclassprotected void doGenerateData(Handle h)
MemoryStream
This 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 MemoryStream
h
- a Handle that can be used to stop the doGenerateData(). If shouldStop
is true then the method should exit immediately.