us.monoid.web
Class Content
java.lang.Object
us.monoid.web.AbstractContent
us.monoid.web.Content
- Direct Known Subclasses:
- FormContent
public class Content
- extends AbstractContent
Class to encapsulate content being sent as payload of a POST or PUT request.
You can use Resty.content(...) to create content objects.
- Author:
- beders
Constructor Summary |
Content(String aMimeType,
byte[] someBytes)
Create a new content object with given mime type and the content as bytes. |
Content
public Content(String aMimeType,
byte[] someBytes)
- Create a new content object with given mime type and the content as bytes.
No check if mime type is 'valid' or similar non-sense is done. You are all grown-ups.
- Parameters:
aMimeType
- the mime type. example: text/plain;charset=UTF-8someBytes
- the content to deliver as bytes
writeContent
public void writeContent(OutputStream os)
throws IOException
- Specified by:
writeContent
in class AbstractContent
- Throws:
IOException
writeHeader
public void writeHeader(OutputStream os)
throws IOException
- Used as a mime part, writing content headers
- Specified by:
writeHeader
in class AbstractContent
- Throws:
IOException
Copyright © 2013. All Rights Reserved.