Class 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)  
      • Methods inherited from class okhttp3.RequestBody

        contentLength, create, create, create, create, create, isDuplex, isOneShot
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 class okhttp3.RequestBody
      • writeTo

        public void writeTo​(okio.BufferedSink sink)
                     throws java.io.IOException
        Specified by:
        writeTo in class okhttp3.RequestBody
        Throws:
        java.io.IOException