Class FeedableBodyGenerator.BaseFeeder
java.lang.Object
com.ning.http.client.providers.grizzly.FeedableBodyGenerator.BaseFeeder
- All Implemented Interfaces:
FeedableBodyGenerator.Feeder
- Direct Known Subclasses:
FeedableBodyGenerator.NonBlockingFeeder,FeedableBodyGenerator.SimpleFeeder
- Enclosing class:
- FeedableBodyGenerator
public abstract static class FeedableBodyGenerator.BaseFeeder
extends Object
implements FeedableBodyGenerator.Feeder
Base class for
FeedableBodyGenerator.Feeder implementations. This class provides
an implementation for the contract defined by the feed(org.glassfish.grizzly.Buffer, boolean) method.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfeed(org.glassfish.grizzly.Buffer buffer, boolean last) This method will write the specifiedBufferto the connection.voidreset()This method will be called if theBodyGeneratoris reused, as with authentication or redirect requests, so that if possible the underlying data is reset.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ning.http.client.providers.grizzly.FeedableBodyGenerator.Feeder
flush
-
Field Details
-
feedableBodyGenerator
-
-
Constructor Details
-
BaseFeeder
-
-
Method Details
-
reset
public void reset()Description copied from interface:FeedableBodyGenerator.FeederThis method will be called if theBodyGeneratoris reused, as with authentication or redirect requests, so that if possible the underlying data is reset.- Specified by:
resetin interfaceFeedableBodyGenerator.Feeder
-
feed
Description copied from interface:FeedableBodyGenerator.FeederThis method will write the specifiedBufferto 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 byFeedableBodyGenerator.setMaxPendingBytes(int). Once this threshold is exceeded, the method will block until the write queue length drops below the aforementioned threshold.- Specified by:
feedin interfaceFeedableBodyGenerator.Feeder- Parameters:
buffer- theBufferto write.last- flag indicating if this is the last buffer to send.- Throws:
IOException- if an I/O error occurs.- See Also:
-