public class DefaultMessageWriter extends Object implements MessageWriter
MessageWriter
.Constructor and Description |
---|
DefaultMessageWriter()
Protected constructor prevents direct instantiation.
|
Modifier and Type | Method and Description |
---|---|
protected OutputStream |
encodeStream(OutputStream out,
String encoding,
boolean binaryBody) |
void |
writeBody(Body body,
OutputStream out)
Write the specified
Body to the specified
OutputStream . |
void |
writeEntity(Entity entity,
OutputStream out)
Write the specified
Entity to the specified
OutputStream . |
void |
writeField(Field field,
OutputStream out)
Write the specified
Field to the specified
OutputStream . |
void |
writeHeader(Header header,
OutputStream out)
Write the specified
Header to the specified
OutputStream . |
void |
writeMessage(Message message,
OutputStream out)
Write the specified
Message to the specified
OutputStream . |
void |
writeMultipart(Multipart multipart,
OutputStream out)
Write the specified
Multipart to the specified
OutputStream . |
public DefaultMessageWriter()
public void writeBody(Body body, OutputStream out) throws IOException
Body
to the specified
OutputStream
.writeBody
in interface MessageWriter
body
- the Body
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.public void writeEntity(Entity entity, OutputStream out) throws IOException
Entity
to the specified
OutputStream
.writeEntity
in interface MessageWriter
entity
- the Entity
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.public void writeMessage(Message message, OutputStream out) throws IOException
Message
to the specified
OutputStream
.writeMessage
in interface MessageWriter
message
- the Message
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.public void writeMultipart(Multipart multipart, OutputStream out) throws IOException
Multipart
to the specified
OutputStream
.writeMultipart
in interface MessageWriter
multipart
- the Multipart
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.public void writeField(Field field, OutputStream out) throws IOException
Field
to the specified
OutputStream
.writeField
in interface MessageWriter
field
- the Field
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.public void writeHeader(Header header, OutputStream out) throws IOException
Header
to the specified
OutputStream
.writeHeader
in interface MessageWriter
header
- the Header
to write.out
- the OutputStream to write to.IOException
- if an I/O error occurs.protected OutputStream encodeStream(OutputStream out, String encoding, boolean binaryBody) throws IOException
IOException
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.