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(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, enc
public 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(URLConnection con) throws java.io.IOException
addContent
in class AbstractContent
con
- the connection to usejava.io.IOException
- if writing to stream failspublic void writeContent(java.io.OutputStream os) throws java.io.IOException
writeContent
in class AbstractContent
java.io.IOException
public void writeHeader(java.io.OutputStream os) throws java.io.IOException
writeHeader
in class AbstractContent
java.io.IOException