public static interface FeedableBodyGenerator.Feeder
FeedableBodyGenerator.NonBlockingFeeder
or FeedableBodyGenerator.SimpleFeeder implementations.| Modifier and Type | Method and Description |
|---|---|
void |
feed(org.glassfish.grizzly.Buffer buffer,
boolean last)
This method will write the specified
Buffer to the connection. |
void |
flush()
This method will be invoked when it's possible to begin feeding
data downstream.
|
void |
reset()
This method will be called if the
BodyGenerator is reused, as
with authentication or redirect requests, so that if possible the
underlying data is reset. |
void flush()
throws IOException
feed(Buffer, boolean)
to perform the actual write.IOException - if an I/O error occurs.void feed(org.glassfish.grizzly.Buffer buffer,
boolean last)
throws IOException
Buffer to the connection.
Be aware that this method may block depending if data is being fed
faster than it can write. How much data may be queued is dictated
by FeedableBodyGenerator.setMaxPendingBytes(int). Once this threshold is exceeded,
the method will block until the write queue length drops below the
aforementioned threshold.buffer - the Buffer to write.last - flag indicating if this is the last buffer to send.IOException - if an I/O error occurs.IllegalArgumentException - if buffer
is null.IllegalStateException - if this method is invoked
before asynchronous transferring has been initiated.FeedableBodyGenerator.setMaxPendingBytes(int)void reset()
BodyGenerator is reused, as
with authentication or redirect requests, so that if possible the
underlying data is reset.Copyright © 2020. All Rights Reserved.