Package com.qiniu.http
Class RequestStreamBody
- java.lang.Object
-
- okhttp3.RequestBody
-
- com.qiniu.http.RequestStreamBody
-
public class RequestStreamBody extends okhttp3.RequestBody
-
-
Constructor Summary
Constructors Constructor Description RequestStreamBody(java.io.InputStream stream, java.lang.String contentType)
构造函数RequestStreamBody(java.io.InputStream stream, okhttp3.MediaType contentType)
构造函数RequestStreamBody(java.io.InputStream stream, okhttp3.MediaType contentType, long limitSize)
构造函数
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.MediaType
contentType()
RequestStreamBody
setSinkSize(long sinkSize)
配置请求时,每次从流中读取的数据大小void
writeTo(okio.BufferedSink sink)
-
-
-
Constructor Detail
-
RequestStreamBody
public RequestStreamBody(java.io.InputStream stream, java.lang.String contentType)
构造函数- Parameters:
stream
- 请求数据流contentType
- 请求数据类型
-
RequestStreamBody
public RequestStreamBody(java.io.InputStream stream, okhttp3.MediaType contentType)
构造函数- Parameters:
stream
- 请求数据流contentType
- 请求数据类型
-
RequestStreamBody
public RequestStreamBody(java.io.InputStream stream, okhttp3.MediaType contentType, long limitSize)
构造函数- Parameters:
stream
- 请求数据流contentType
- 请求数据类型limitSize
- 最大读取 stream 的大小;为 -1 时不限制读取所有
-
-
Method Detail
-
setSinkSize
public RequestStreamBody setSinkSize(long sinkSize)
配置请求时,每次从流中读取的数据大小- Parameters:
sinkSize
- 每次从流中读取的数据大小- Returns:
- RequestStreamBody
- See Also:
writeTo(BufferedSink)
-
contentType
public okhttp3.MediaType contentType()
- Specified by:
contentType
in classokhttp3.RequestBody
-
writeTo
public void writeTo(okio.BufferedSink sink) throws java.io.IOException
- Specified by:
writeTo
in classokhttp3.RequestBody
- Throws:
java.io.IOException
-
-