public class InputStreamBodyGenerator extends Object implements BodyGenerator
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.Modifier and Type | Class and Description |
---|---|
protected class |
InputStreamBodyGenerator.ISBody |
Constructor and Description |
---|
InputStreamBodyGenerator(InputStream inputStream) |
Modifier and Type | Method and Description |
---|---|
Body |
createBody()
Creates a new instance of the request body to be read.
|
InputStream |
getInputStream() |
void |
patchNettyChunkingIssue(boolean patchNettyChunkingIssue)
HACK: This is required because Netty has issues with chunking.
|
public InputStreamBodyGenerator(InputStream inputStream)
public InputStream getInputStream()
public Body createBody() throws IOException
BodyGenerator
createBody
in interface BodyGenerator
null
.IOException
- If the body could not be created.public void patchNettyChunkingIssue(boolean patchNettyChunkingIssue)
patchNettyChunkingIssue
- Copyright © 2015. All Rights Reserved.