public class Output<T extends Buffer> extends IOEvent<T>
This event signals that a new chunk of internally generated data is to be forwarded to some destination. This type of event is commonly used for data flowing out of the application.
completed, completionEvents
Constructor and Description |
---|
Output(Output<T> event)
Create a new event from an existing event.
|
Modifier and Type | Method and Description |
---|---|
static Output<ByteBuffer> |
from(byte[] data,
boolean endOfRecord)
Convenience method that creates a
Output<ByteBuffer> event from a byte[] . |
static Output<CharBuffer> |
from(String data,
boolean endOfRecord)
Convenience method that creates a
Output<CharBuffer> event from a String . |
static <B extends Buffer> |
fromSink(ManagedBuffer<B> buffer,
boolean endOfRecord)
Create a new event with the given buffer.
|
static <B extends Buffer> |
fromSource(ManagedBuffer<B> buffer,
boolean endOfRecord)
Create a new event with the given buffer.
|
buffer, data, handled, hasRemaining, isEndOfRecord, remaining, toString
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, setAssociated, setChannels, setRequiresResult, setResult, stop, tieTo
disableTracking, enqueued, firstResultAssigned, isTracked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
associated, associated, associated
public static <B extends Buffer> Output<B> fromSource(ManagedBuffer<B> buffer, boolean endOfRecord)
Create a new event with the given buffer. The buffer must
have been prepared for invoking get
-methods.
buffer
- the buffer with the dataendOfRecord
- if the event ends a data recordpublic static <B extends Buffer> Output<B> fromSink(ManagedBuffer<B> buffer, boolean endOfRecord)
Create a new event with the given buffer. Creating the event flips the buffer, which is assumed to have been used for collecting data up to now.
buffer
- the buffer with the dataendOfRecord
- if the event ends a data recordpublic static Output<CharBuffer> from(String data, boolean endOfRecord)
Convenience method that creates a
Output<CharBuffer>
event from a String
.
data
- the string to wrapendOfRecord
- if the event ends a data recordpublic static Output<ByteBuffer> from(byte[] data, boolean endOfRecord)
Convenience method that creates a
Output<ByteBuffer>
event from a byte[]
.
data
- the array to wrapendOfRecord
- if the event ends a data record