public final class InputStreamBodyGenerator extends Object implements BodyGenerator
BodyGenerator
which use an InputStream
for reading bytes, without having to read the entire stream in memory.
InputStream
must support the InputStream.mark(int)
and InputStream.reset()
operation. If not, mechanisms like authentication, redirect, or
resumable download will not works.Constructor and Description |
---|
InputStreamBodyGenerator(InputStream inputStream) |
InputStreamBodyGenerator(InputStream inputStream,
long contentLength) |
Modifier and Type | Method and Description |
---|---|
Body |
createBody()
Creates a new instance of the request body to be read.
|
long |
getContentLength() |
InputStream |
getInputStream() |
public InputStreamBodyGenerator(InputStream inputStream)
public InputStreamBodyGenerator(InputStream inputStream, long contentLength)
public InputStream getInputStream()
public long getContentLength()
public Body createBody()
createBody
in interface BodyGenerator
null
.Copyright © 2019. All rights reserved.