public class Content extends AbstractContent
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
content |
protected java.lang.String |
mime |
CRLF| Constructor and Description |
|---|
Content(java.lang.String aMimeType,
byte[] someBytes)
Create a new content object with given mime type and the content as bytes.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addContent(java.net.URLConnection con)
Add the content to the URLConnection used.
|
void |
writeContent(java.io.OutputStream os) |
void |
writeHeader(java.io.OutputStream os)
Used as a mime part, writing content headers
|
ascii, encpublic Content(java.lang.String aMimeType,
byte[] someBytes)
aMimeType - the mime type. example: text/plain;charset=UTF-8someBytes - the content to deliver as bytesprotected void addContent(java.net.URLConnection con)
throws java.io.IOException
addContent in class AbstractContentcon - the connection to usejava.io.IOException - if writing to stream failspublic void writeContent(java.io.OutputStream os)
throws java.io.IOException
writeContent in class AbstractContentjava.io.IOExceptionpublic void writeHeader(java.io.OutputStream os)
throws java.io.IOException
writeHeader in class AbstractContentjava.io.IOException