|
Restlet Framework 2.2.2 Android |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.ReadingListener
public abstract class ReadingListener
Selection listener notifying new content is read into a ByteBuffer
.
Constructor Summary | |
---|---|
ReadingListener(java.nio.channels.ReadableByteChannel byteChannel,
java.nio.ByteBuffer byteBuffer)
Constructor. |
|
ReadingListener(java.nio.channels.ReadableByteChannel byteChannel,
int bufferSize)
Constructor. |
|
ReadingListener(Representation source)
Default constructor. |
|
ReadingListener(Representation source,
int bufferSize)
Constructor. |
Method Summary | |
---|---|
protected abstract void |
onContent(java.nio.ByteBuffer byteBuffer)
Callback invoked when new content is available. |
protected void |
onEnd()
Callback invoked when the end of the representation has been reached. |
protected void |
onError(java.io.IOException ioe)
Callback invoked when an IO exception occurs. |
void |
onSelected(SelectionRegistration selectionRegistration)
Callback invoked when new content is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadingListener(java.nio.channels.ReadableByteChannel byteChannel, java.nio.ByteBuffer byteBuffer) throws java.io.IOException
byteChannel
- The source byte channel.byteBuffer
- The byte buffer to use.
java.io.IOException
public ReadingListener(java.nio.channels.ReadableByteChannel byteChannel, int bufferSize) throws java.io.IOException
byteChannel
- The source byte channel.bufferSize
- The size of the byte buffer to use.
java.io.IOException
public ReadingListener(Representation source) throws java.io.IOException
IoUtils.BUFFER_SIZE
length.
source
- The source representation.
java.io.IOException
public ReadingListener(Representation source, int bufferSize) throws java.io.IOException
source
- The source byte channel.bufferSize
- The size of the byte buffer to use.
java.io.IOException
Method Detail |
---|
protected abstract void onContent(java.nio.ByteBuffer byteBuffer)
byteBuffer
- The byte buffer filled with the new content (correctly flip).protected void onEnd()
protected void onError(java.io.IOException ioe)
Level.WARNING
level.
ioe
- The exception caught.public final void onSelected(SelectionRegistration selectionRegistration) throws java.io.IOException
onContent(ByteBuffer)
method or the onEnd()
method or
the onError(IOException)
method.
onSelected
in interface SelectionListener
selectionRegistration
- The selected registration.
java.io.IOException
|
Restlet Framework 2.2.2 Android |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |