Package net.anwiba.commons.http.apache
Class InputStreamEntity
- java.lang.Object
-
- org.apache.hc.core5.http.io.entity.AbstractHttpEntity
-
- net.anwiba.commons.http.apache.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 voidclose()java.io.InputStreamgetContent()longgetContentLength()booleanisRepeatable()booleanisStreaming()voidwriteTo(java.io.OutputStream outstream)
-
-
-
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:
isRepeatablein interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
isRepeatablein classorg.apache.hc.core5.http.io.entity.AbstractHttpEntity
-
getContentLength
public long getContentLength()
- Returns:
- the content length or
-1if 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:
writeToin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
writeToin classorg.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
-
-