|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.io.MimeOutputStream
This class defines a Mime wrapped OutputStream. It has methods to fill in
fields of a MimeHeader, then it takes all the fields filled in and
composes a Mime header, adds the message if any and sends everything
trought a DataOutput stream.
This implementation is based on the SET book appendix E. It is
able to handle the Mime fields describe in that book. But this
implementation can easely be extended to handle new fields.
HOW TO USE
- connect this class to a DataOutputStream (done in the constructor)
- set the Mime fields using the setters writeXxxx()
- call writeMime() to really build the Mime header and write it to the
DataOutputStream followed by a message
The message is a byte array.
BEWARE this class doesn't reset the fields if it is used to send a second
message, it is up to the user to do so or to and a reset method.
Constructor Summary | |
---|---|
MimeOutputStream(DataOutputStream dos)
Creates a new MimeOutput stream to write data to a DataOutputStream. |
Method Summary | |
---|---|
void |
setContentType(String content)
Stores the content-type field to be used then the writeMime() method is called. |
void |
setContentTypeClass(String ctClass)
Stores the content-type class field to be used then the writeMime() method is called. |
void |
setContentTypeControl(String ctControl)
Stores the content-type control field to be used then the writeMime() method is called. |
void |
setContentTypeDelay(int ctDelay)
Stores the content-type delay field to be used then the writeMime() method is called. |
void |
setContentTypeMsgTag(String ctMsgTag)
Stores the content-type message tag field to be used then the writeMime() method is called. |
void |
setEncoding(String encoding)
Stores the Encoding field to be used then the writeMime() method is called. |
void |
setLength(int length)
Stores the Length field to be used then the writeMime() method is called. |
void |
setMessage(byte[] baMsg)
Stores the byte array containing the message to be used then the writeMime() method is called. |
void |
writeMime()
This method takes Mime fields and converts them into an OutputStream At least the content-type field has to be filled in. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MimeOutputStream(DataOutputStream dos)
dos
- the DataOutput streamMethod Detail |
public void writeMime() throws IOException
public void setContentType(String content)
content
- The content-type fieldpublic void setContentTypeMsgTag(String ctMsgTag)
ctMsgTag
- The content-type message tag fieldpublic void setContentTypeControl(String ctControl)
ctControl
- The content-type control fieldpublic void setContentTypeClass(String ctClass)
ctClass
- The content-type class fieldpublic void setContentTypeDelay(int ctDelay)
ctDelay
- The content-type delay fieldpublic void setEncoding(String encoding)
encoding
- The Encoding fieldpublic void setLength(int length)
length
- The Length fieldpublic void setMessage(byte[] baMsg)
baMsg
- The byte array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |