public abstract class ByteReadingListener extends ReadingListener
InputStream
.Constructor and Description |
---|
ByteReadingListener(Representation source)
Default constructor.
|
ByteReadingListener(Representation source,
int bufferSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onContent(java.nio.ByteBuffer byteBuffer)
Callback invoked when new content is available.
|
protected abstract void |
onContent(java.io.InputStream inputStream)
Callback invoked when new content is available.
|
onEnd, onError, onSelected
public ByteReadingListener(Representation source) throws java.io.IOException
IoUtils.BUFFER_SIZE
length.source
- The source representation.java.io.IOException
public ByteReadingListener(Representation source, int bufferSize) throws java.io.IOException
source
- The source byte channel.bufferSize
- The byte buffer to use.java.io.IOException
protected final void onContent(java.nio.ByteBuffer byteBuffer)
onContent
in class ReadingListener
byteBuffer
- The byte buffer filled with the new content (correctly flip).protected abstract void onContent(java.io.InputStream inputStream)
inputStream
- The input stream allowing to retrieve the new content.Copyright © 2005-2024 Restlet.