Class InputStreamBody

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long contentLength  
      private java.lang.String filename  
      private java.io.InputStream in  
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamBody​(java.io.InputStream in, java.lang.String filename)  
      InputStreamBody​(java.io.InputStream in, org.apache.hc.core5.http.ContentType contentType)  
      InputStreamBody​(java.io.InputStream in, org.apache.hc.core5.http.ContentType contentType, java.lang.String filename)  
      InputStreamBody​(java.io.InputStream in, org.apache.hc.core5.http.ContentType contentType, java.lang.String filename, long contentLength)  
    • Field Detail

      • in

        private final java.io.InputStream in
      • filename

        private final java.lang.String filename
      • contentLength

        private final long contentLength
    • Constructor Detail

      • InputStreamBody

        public InputStreamBody​(java.io.InputStream in,
                               java.lang.String filename)
      • InputStreamBody

        public InputStreamBody​(java.io.InputStream in,
                               org.apache.hc.core5.http.ContentType contentType,
                               java.lang.String filename)
        Since:
        4.3
      • InputStreamBody

        public InputStreamBody​(java.io.InputStream in,
                               org.apache.hc.core5.http.ContentType contentType,
                               java.lang.String filename,
                               long contentLength)
        Since:
        4.6
      • InputStreamBody

        public InputStreamBody​(java.io.InputStream in,
                               org.apache.hc.core5.http.ContentType contentType)
        Since:
        4.3
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getContentLength

        public long getContentLength()
        Description copied from interface: ContentDescriptor
        Returns the body descriptors content-length.
        Returns:
        Content length, if known, or -1, to indicate the absence of a content-length header.
      • getFilename

        public java.lang.String getFilename()