Class NonBlockingInputStreamFeeder
java.lang.Object
com.ning.http.client.providers.grizzly.FeedableBodyGenerator.BaseFeeder
com.ning.http.client.providers.grizzly.FeedableBodyGenerator.NonBlockingFeeder
com.ning.http.client.providers.grizzly.NonBlockingInputStreamFeeder
- All Implemented Interfaces:
FeedableBodyGenerator.Feeder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ning.http.client.providers.grizzly.FeedableBodyGenerator.NonBlockingFeeder
FeedableBodyGenerator.NonBlockingFeeder.ReadyToFeedListener -
Field Summary
FieldsFields inherited from class com.ning.http.client.providers.grizzly.FeedableBodyGenerator.BaseFeeder
feedableBodyGenerator -
Constructor Summary
ConstructorsConstructorDescriptionNonBlockingInputStreamFeeder(FeedableBodyGenerator feedableBodyGenerator, InputStream content) NonBlockingInputStreamFeeder(FeedableBodyGenerator feedableBodyGenerator, InputStream content, int internalBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidcanFeed()Notification that it's possible to send another block of data viaFeedableBodyGenerator.BaseFeeder.feed(org.glassfish.grizzly.Buffer, boolean).booleanisDone()booleanisReady()voidCallback registration to signal theFeedableBodyGeneratorthat data is available once again to continue feeding.protected booleanonFullWriteQueue(org.glassfish.grizzly.Connection c) 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 com.ning.http.client.providers.grizzly.FeedableBodyGenerator.NonBlockingFeeder
flushMethods inherited from class com.ning.http.client.providers.grizzly.FeedableBodyGenerator.BaseFeeder
feed
-
Field Details
-
-
Constructor Details
-
NonBlockingInputStreamFeeder
public NonBlockingInputStreamFeeder(FeedableBodyGenerator feedableBodyGenerator, InputStream content) -
NonBlockingInputStreamFeeder
public NonBlockingInputStreamFeeder(FeedableBodyGenerator feedableBodyGenerator, InputStream content, int internalBufferSize)
-
-
Method Details
-
canFeed
Description copied from class:FeedableBodyGenerator.NonBlockingFeederNotification that it's possible to send another block of data viaFeedableBodyGenerator.BaseFeeder.feed(org.glassfish.grizzly.Buffer, boolean). It's important to only invokeFeedableBodyGenerator.BaseFeeder.feed(Buffer, boolean)once per invocation ofFeedableBodyGenerator.NonBlockingFeeder.canFeed().- Specified by:
canFeedin classFeedableBodyGenerator.NonBlockingFeeder- Throws:
IOException
-
isDone
public boolean isDone()- Specified by:
isDonein classFeedableBodyGenerator.NonBlockingFeeder- Returns:
trueif all data has been fed by this feeder, otherwise returnsfalse.
-
isReady
public boolean isReady()- Specified by:
isReadyin classFeedableBodyGenerator.NonBlockingFeeder- Returns:
trueif data is available to be fed, otherwise returnsfalse. When this method returnsfalse, theFeedableBodyGeneratorwill callFeedableBodyGenerator.NonBlockingFeeder.notifyReadyToFeed(ReadyToFeedListener)by which thisFeedableBodyGenerator.NonBlockingFeederimplementation may signal data is once again available to be fed.
-
notifyReadyToFeed
Description copied from class:FeedableBodyGenerator.NonBlockingFeederCallback registration to signal theFeedableBodyGeneratorthat data is available once again to continue feeding. Once this listener has been invoked, the NonBlockingFeeder implementation should no longer maintain a reference to the listener.- Specified by:
notifyReadyToFeedin classFeedableBodyGenerator.NonBlockingFeeder
-
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- Overrides:
resetin classFeedableBodyGenerator.BaseFeeder
-
onFullWriteQueue
protected boolean onFullWriteQueue(org.glassfish.grizzly.Connection c) - Overrides:
onFullWriteQueuein classFeedableBodyGenerator.NonBlockingFeeder
-