Class InputStreamBody
java.lang.Object
org.apache.hc.client5.http.entity.mime.AbstractContentBody
org.apache.hc.client5.http.entity.mime.InputStreamBody
- All Implemented Interfaces:
ContentBody
,ContentDescriptor
Binary body part backed by an input stream.
- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final String
private final InputStream
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamBody
(InputStream in, String filename) InputStreamBody
(InputStream in, org.apache.hc.core5.http.ContentType contentType) InputStreamBody
(InputStream in, org.apache.hc.core5.http.ContentType contentType, String filename) InputStreamBody
(InputStream in, org.apache.hc.core5.http.ContentType contentType, String filename, long contentLength) -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the body descriptors content-length.void
writeTo
(OutputStream out) Methods inherited from class org.apache.hc.client5.http.entity.mime.AbstractContentBody
getCharset, getContentType, getMediaType, getMimeType, getSubType
-
Field Details
-
in
-
filename
-
contentLength
private final long contentLength
-
-
Constructor Details
-
InputStreamBody
-
InputStreamBody
public InputStreamBody(InputStream in, org.apache.hc.core5.http.ContentType contentType, String filename) - Since:
- 4.3
-
InputStreamBody
public InputStreamBody(InputStream in, org.apache.hc.core5.http.ContentType contentType, String filename, long contentLength) - Since:
- 4.6
-
InputStreamBody
- Since:
- 4.3
-
-
Method Details
-
getInputStream
-
writeTo
- Throws:
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
-