|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.io.MimeInputStream
This class defines a Mime wrapped InputStream. It reads data from an Input
stream, looks for the Mime header, processes it to extract the known
fields. When the length is found, it reads the message that is Mime
wrapped.
This implementation is based on the SET book appendix E. It is
able to recognize the Mime fields describe in that book. If other Mime
fields are present in the header they will be ignored.
This implementation can easely be extended to recognize new fields.
HOW TO USE IT
- connect this class to a TimeOutInputStream (done in the constructor)
- call readMime() to process the stream. If the TimeOutInputStream doesn't
contain any MimeHeader an IOException is thrown.
- if the TimeOutInputStream does contain a Mime Header the getters
readXxxx() can be called to retrieved the values of the fields.
Constructor Summary | |
---|---|
MimeInputStream(TimeOutInputStream tois)
Creates a new Mime input stream to read data from the specified TimeOut input stream. |
Method Summary | |
---|---|
String |
getContentType()
Returns the content-type field found after calling the readMime() method. |
String |
getContentTypeClass()
Returns the content-type class field found after calling the readMime() method. |
String |
getContentTypeControl()
Returns the content-type control field found after calling the readMime() method. |
int |
getContentTypeDelay()
Returns the content-type delay field found after calling the readMime() method. |
String |
getContentTypeMsgTag()
Returns the content-type message tag field found after calling the readMime() method. |
String |
getEncoding()
Returns the encoding field found after calling the readMime() method. |
int |
getLength()
Returns the Length field found after calling the readMime() method. |
byte[] |
getMessage()
Returns the byte array containing the message found after calling the readMime() method. |
String |
getMimeVersion()
Returns the Mime version field found after calling the readMime() method. |
void |
readMime()
This method reads and parses a Mime wrapped TimeOutInputStream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MimeInputStream(TimeOutInputStream tois)
tois
- the TimeOut input streamMethod Detail |
public void readMime() throws IOException
public String getMimeVersion()
public String getContentType()
public String getContentTypeMsgTag()
public String getContentTypeControl()
public String getContentTypeClass()
public int getContentTypeDelay()
public String getEncoding()
public int getLength()
public byte[] getMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |