Package com.ning.http.client.generators
Class InputStreamBodyGenerator
java.lang.Object
com.ning.http.client.generators.InputStreamBodyGenerator
- All Implemented Interfaces:
BodyGenerator
A
BodyGenerator which use an InputStream for reading bytes, without having to read the entire
stream in memory.
NOTE: The InputStream must support the InputStream.mark(int) and InputStream.reset() operation.
If not, mechanisms like authentication, redirect, or resumable download will not works.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of the request body to be read.protected InputStreamBodyGenerator.ISBodyvoidpatchNettyChunkingIssue(boolean patchNettyChunkingIssue) HACK: This is required because Netty has issues with chunking.
-
Field Details
-
inputStream
-
-
Constructor Details
-
InputStreamBodyGenerator
-
-
Method Details
-
getInputStream
-
createBody
Description copied from interface:BodyGeneratorCreates a new instance of the request body to be read. While each invocation of this method is supposed to create a fresh instance of the body, the actual contents of all these body instances is the same. For example, the body needs to be resend after an authentication challenge of a redirect.- Specified by:
createBodyin interfaceBodyGenerator- Returns:
- The request body, never
null. - Throws:
IOException- If the body could not be created.
-
doCreateBody
-
patchNettyChunkingIssue
public void patchNettyChunkingIssue(boolean patchNettyChunkingIssue) HACK: This is required because Netty has issues with chunking.- Parameters:
patchNettyChunkingIssue-
-