abstract class OutputStreamRequestBody extends RequestBody
BufferedRequestBody
) or streamed (with StreamedRequestBody
).
In either case the bytes of the body aren't known until the caller writes them to the output
stream.Modifier and Type | Field and Description |
---|---|
(package private) boolean |
closed |
private long |
expectedContentLength |
private java.io.OutputStream |
outputStream |
private okio.Timeout |
timeout |
Constructor and Description |
---|
OutputStreamRequestBody() |
Modifier and Type | Method and Description |
---|---|
long |
contentLength()
Returns the number of bytes that will be written to
sink in a call to RequestBody.writeTo(okio.BufferedSink) ,
or -1 if that count is unknown. |
MediaType |
contentType()
Returns the Content-Type header for this body.
|
protected void |
initOutputStream(okio.BufferedSink sink,
long expectedContentLength) |
boolean |
isClosed() |
java.io.OutputStream |
outputStream() |
Request |
prepareToSendRequest(Request request) |
okio.Timeout |
timeout() |
private okio.Timeout timeout
private long expectedContentLength
private java.io.OutputStream outputStream
boolean closed
protected void initOutputStream(okio.BufferedSink sink, long expectedContentLength)
public final java.io.OutputStream outputStream()
public final okio.Timeout timeout()
public final boolean isClosed()
public long contentLength() throws java.io.IOException
RequestBody
sink
in a call to RequestBody.writeTo(okio.BufferedSink)
,
or -1 if that count is unknown.contentLength
in class RequestBody
java.io.IOException
public final MediaType contentType()
RequestBody
contentType
in class RequestBody