public class DiscardingInputStreamConsumer extends AbstractInputStreamConsumer
InputStream
, discarding what is read as it goes, until it
encounters the end of the stream or an exception is thrown.
stream
Constructor and Description |
---|
DiscardingInputStreamConsumer(java.io.InputStream stream,
int bufferSize)
Creates an instance with the specified stream and buffer size.
|
Modifier and Type | Method and Description |
---|---|
protected java.nio.ByteBuffer |
data()
Returns the data consumed from the input stream.
|
static InputStreamConsumerFactory |
newFactory(int bufferSize)
Creates a factory that returns a new instance of this class with the
specified buffer size.
|
protected int |
read()
Reads a chunk of data from the input stream.
|
call, cancel, postProcessData
public DiscardingInputStreamConsumer(java.io.InputStream stream, int bufferSize)
stream
- stream from which to readbufferSize
- size of read buffer used if skip(long)
is not
supported by the input streamprotected int read() throws java.io.IOException
AbstractInputStreamConsumer
read
in class AbstractInputStreamConsumer
java.io.IOException
- if an I/O error occursprotected java.nio.ByteBuffer data()
AbstractInputStreamConsumer
data
in class AbstractInputStreamConsumer
public static InputStreamConsumerFactory newFactory(int bufferSize)
bufferSize
- size of read buffer used if skip(long)
is not
supported by the input stream