public interface BodyFactory
Modifier and Type | Method and Description |
---|---|
BinaryBody |
binaryBody(InputStream is)
Creates a
BinaryBody that holds the content of the given input
stream. |
TextBody |
textBody(InputStream is,
String mimeCharset)
Creates a
TextBody that holds the content of the given input
stream. |
BinaryBody binaryBody(InputStream is) throws IOException
BinaryBody
that holds the content of the given input
stream.is
- input stream to create a message body from.IOException
- if an I/O error occurs.TextBody textBody(InputStream is, String mimeCharset) throws IOException
TextBody
that holds the content of the given input
stream.
The charset corresponding to the given MIME charset name is used to
decode the byte content of the input stream into a character stream when
calling getReader()
on the returned object.
If the MIME charset has no corresponding Java charset or the Java charset
cannot be used for decoding then "us-ascii" is used instead.
is
- input stream to create a message body from.mimeCharset
- name of a MIME charset.IOException
- if an I/O error occurs.Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.