public class MessageWriter
extends java.lang.Object
This class cannot be instantiated; instead the static instance
DEFAULT
implements the default strategy for writing a message.
This class may be subclassed to implement custom strategies for writing messages.
Modifier and Type | Field and Description |
---|---|
static MessageWriter |
DEFAULT
The default message writer.
|
Modifier | Constructor and Description |
---|---|
protected |
MessageWriter()
Protected constructor prevents direct instantiation.
|
Modifier and Type | Method and Description |
---|---|
protected java.io.OutputStream |
encodeStream(java.io.OutputStream out,
java.lang.String encoding,
boolean binaryBody) |
void |
writeBody(Body body,
java.io.OutputStream out)
Write the specified
Body to the specified
OutputStream . |
void |
writeEntity(Entity entity,
java.io.OutputStream out)
Write the specified
Entity to the specified
OutputStream . |
void |
writeHeader(Header header,
java.io.OutputStream out)
Write the specified
Header to the specified
OutputStream . |
void |
writeMultipart(Multipart multipart,
java.io.OutputStream out)
Write the specified
Multipart to the specified
OutputStream . |
public static final MessageWriter DEFAULT
protected MessageWriter()
public void writeBody(Body body, java.io.OutputStream out) throws java.io.IOException
Body
to the specified
OutputStream
.body
- the Body
to write.out
- the OutputStream to write to.java.io.IOException
- if an I/O error occurs.public void writeEntity(Entity entity, java.io.OutputStream out) throws java.io.IOException
Entity
to the specified
OutputStream
.entity
- the Entity
to write.out
- the OutputStream to write to.java.io.IOException
- if an I/O error occurs.public void writeMultipart(Multipart multipart, java.io.OutputStream out) throws java.io.IOException
Multipart
to the specified
OutputStream
.multipart
- the Multipart
to write.out
- the OutputStream to write to.java.io.IOException
- if an I/O error occurs.public void writeHeader(Header header, java.io.OutputStream out) throws java.io.IOException
Header
to the specified
OutputStream
.header
- the Header
to write.out
- the OutputStream to write to.java.io.IOException
- if an I/O error occurs.protected java.io.OutputStream encodeStream(java.io.OutputStream out, java.lang.String encoding, boolean binaryBody) throws java.io.IOException
java.io.IOException
Copyright © 2004-2012. All Rights Reserved.