java.lang.Object
org.apache.hc.core5.http.io.entity.AbstractHttpEntity
net.anwiba.commons.http.apache.InputStreamEntity
- All Implemented Interfaces:
Closeable,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
ConstructorsConstructorDescriptionInputStreamEntity(IClosure<InputStream, IOException> contentClosure, long length, org.apache.hc.core5.http.ContentType contentType, String encoding) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longbooleanbooleanvoidwriteTo(OutputStream outstream) Methods inherited from class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
getContentEncoding, getContentType, getTrailerNames, getTrailers, isChunked, toString, writeTo
-
Constructor Details
-
InputStreamEntity
public InputStreamEntity(IClosure<InputStream, IOException> contentClosure, long length, org.apache.hc.core5.http.ContentType contentType, String encoding)
-
-
Method Details
-
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
- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
writeToin classorg.apache.hc.core5.http.io.entity.AbstractHttpEntity- Throws:
IOException
-
isStreaming
public boolean isStreaming() -
close
- Throws:
IOException
-