Class InputStreamBody
- java.lang.Object
-
- com.foxinmy.weixin4j.http.apache.content.AbstractContentBody
-
- com.foxinmy.weixin4j.http.apache.content.InputStreamBody
-
- All Implemented Interfaces:
ContentBody
public class InputStreamBody extends AbstractContentBody
Binary body part backed by an input stream.- Since:
- 4.0
- See Also:
org.apache.http.entity.mime.MultipartEntityBuilder
-
-
Constructor Summary
Constructors Constructor Description InputStreamBody(InputStream in, ContentType contentType)
InputStreamBody(InputStream in, ContentType contentType, String filename)
InputStreamBody(InputStream in, String filename)
InputStreamBody(InputStream in, String mimeType, String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getContentLength()
Returns the body descriptors content-length.String
getFilename()
InputStream
getInputStream()
String
getTransferEncoding()
Returns the body descriptors transfer encoding.void
writeTo(OutputStream out)
-
Methods inherited from class com.foxinmy.weixin4j.http.apache.content.AbstractContentBody
getCharset, getContentType, getMimeType
-
-
-
-
Constructor Detail
-
InputStreamBody
public InputStreamBody(InputStream in, String mimeType, String filename)
- Since:
- 4.1
-
InputStreamBody
public InputStreamBody(InputStream in, String filename)
-
InputStreamBody
public InputStreamBody(InputStream in, ContentType contentType, String filename)
- Since:
- 4.3
-
InputStreamBody
public InputStreamBody(InputStream in, ContentType contentType)
- Since:
- 4.3
-
-
Method Detail
-
getInputStream
public InputStream getInputStream()
-
writeTo
public void writeTo(OutputStream out) throws IOException
- Throws:
IOException
-
getTransferEncoding
public String getTransferEncoding()
Description copied from interface:ContentBody
Returns the body descriptors transfer encoding.- Returns:
- The transfer encoding. Must not be null, but "7bit", if no transfer-encoding was specified.
-
getContentLength
public long getContentLength()
Description copied from interface:ContentBody
Returns the body descriptors content-length.- Returns:
- Content length, if known, or -1, to indicate the absence of a content-length header.
-
getFilename
public String getFilename()
-
-