Class InputStreamEntity

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.HttpEntity

    public class InputStreamEntity
    extends org.apache.hc.core5.http.io.entity.AbstractHttpEntity
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamEntity​(IClosure<java.io.InputStream,​java.io.IOException> contentClosure, long length, org.apache.hc.core5.http.ContentType contentType, java.lang.String encoding)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.io.InputStream getContent()  
      long getContentLength()  
      boolean isRepeatable()  
      boolean isStreaming()  
      void writeTo​(java.io.OutputStream outstream)  
      • Methods inherited from class org.apache.hc.core5.http.io.entity.AbstractHttpEntity

        getContentEncoding, getContentType, getTrailerNames, getTrailers, isChunked, toString, writeTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InputStreamEntity

        public InputStreamEntity​(IClosure<java.io.InputStream,​java.io.IOException> contentClosure,
                                 long length,
                                 org.apache.hc.core5.http.ContentType contentType,
                                 java.lang.String encoding)
    • Method Detail

      • isRepeatable

        public boolean isRepeatable()
        Specified by:
        isRepeatable in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        isRepeatable in class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
      • getContentLength

        public long getContentLength()
        Returns:
        the content length or -1 if unknown
      • getContent

        public java.io.InputStream getContent()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream outstream)
                     throws java.io.IOException
        Specified by:
        writeTo in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        writeTo in class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
        Throws:
        java.io.IOException
      • isStreaming

        public boolean isStreaming()
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException