|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.kitcashcassette.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.
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 add a reset method.
Field Summary | |
---|---|
protected byte[] |
baMsg
|
protected java.lang.String |
content
|
protected java.lang.String |
ctClass
|
protected java.lang.String |
ctControl
|
protected int |
ctDelay
|
protected java.lang.String |
ctMsgTag
|
protected java.io.OutputStream |
dos
|
protected java.lang.String |
encoding
|
protected int |
length
|
Fields inherited from interface com.ibm.etill.kitcashcassette.io.MimeConst |
---|
MAX_SIZE_MIMEHEADER, MHL_CTENCODING, MHL_CTENCODING_7BIT, MHL_CTENCODING_BIN, MHL_CTYPE, MHL_CTYPE_APP, MHL_CTYPE_CLASS, MHL_CTYPE_CLASS_CLOSING, MHL_CTYPE_CLASS_FAILED, MHL_CTYPE_CLASS_INFO, MHL_CTYPE_CLASS_RETRY, MHL_CTYPE_CONTROL, MHL_CTYPE_CONTROL_CLOSE, MHL_CTYPE_CONTROL_CLOSER, MHL_CTYPE_CONTROL_ECHO, MHL_CTYPE_CONTROL_ECHOR, MHL_CTYPE_CONTROL_STATUS, MHL_CTYPE_DELAY, MHL_CTYPE_MSGTAG, MHL_CTYPE_SEP, MHL_CTYPE_TXT, MHL_EOHEADER, MHL_EOL, MHL_EQUAL, MHL_LENGTH, MHL_MVERSION, MHL_SEP, MHL_SPACE, MHL_VERSION |
Constructor Summary | |
---|---|
MimeOutputStream(java.io.DataOutputStream dos)
Creates a new MimeOutput stream to write data to a DataOutputStream. |
Method Summary | |
---|---|
void |
setContentType(java.lang.String content)
Stores the content-type field to be used when the writeMime() method is called. |
void |
setContentTypeClass(java.lang.String ctClass)
Stores the content-type class field to be used when the writeMime() method is called. |
void |
setContentTypeControl(java.lang.String ctControl)
Stores the content-type control field to be used when the writeMime() method is called. |
void |
setContentTypeDelay(int ctDelay)
Stores the content-type delay field to be used when the writeMime() method is called. |
void |
setContentTypeMsgTag(java.lang.String ctMsgTag)
Stores the content-type message tag field to be used when the writeMime() method is called. |
void |
setEncoding(java.lang.String encoding)
Stores the Encoding field to be used when the writeMime() method is called. |
void |
setLength(int length)
Stores the Length field to be used when the writeMime() method is called. |
void |
setMessage(byte[] baMsg)
Stores the byte array containing the message to be used when the writeMime() method is called. |
void |
writeMime()
This method takes Mime fields and converts them into an OutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.OutputStream dos
protected java.lang.String content
protected java.lang.String ctMsgTag
protected java.lang.String ctControl
protected java.lang.String ctClass
protected int ctDelay
protected java.lang.String encoding
protected int length
protected byte[] baMsg
Constructor Detail |
public MimeOutputStream(java.io.DataOutputStream dos)
dos
- the DataOutput streamMethod Detail |
public void setContentType(java.lang.String content)
content
- The content-type fieldpublic void setContentTypeClass(java.lang.String ctClass)
ctClass
- The content-type class fieldpublic void setContentTypeControl(java.lang.String ctControl)
ctControl
- The content-type control fieldpublic void setContentTypeDelay(int ctDelay)
ctDelay
- The content-type delay fieldpublic void setContentTypeMsgTag(java.lang.String ctMsgTag)
ctMsgTag
- The content-type message tag fieldpublic void setEncoding(java.lang.String encoding)
encoding
- The Encoding fieldpublic void setLength(int length)
length
- The Length fieldpublic void setMessage(byte[] baMsg)
baMsg
- The byte arraypublic void writeMime() throws java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |