|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--dtw.webmail.util.MultipartInputStream
Class that provides a MultipartInputStream by wrapping
an existant InputStream.
It implements size limit checking and serves as a
DataSource for handling with
Mail API (or other JAF aware) classes.
| Field Summary |
| Fields inherited from class java.io.FilterInputStream |
in |
| Constructor Summary | |
MultipartInputStream(java.io.InputStream in,
java.lang.String ctype,
int readlimit)
Constructs a MultipartInputStream instance. |
|
| Method Summary | |
java.lang.String |
getContentType()
Returns the content type of this instance as String. |
java.io.InputStream |
getInputStream()
Returns this MultipartInputStream instance as InputStream. |
java.lang.String |
getName()
Returns the name of this instance as String. |
java.io.OutputStream |
getOutputStream()
Throws an IOException in this implementation, because this instance represents a read-only DataSource. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream into an array of bytes. |
| Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MultipartInputStream(java.io.InputStream in,
java.lang.String ctype,
int readlimit)
in - the InputStream this instance reads from.ctype - the content type of the incoming request as
String. Important because it contains the parts border!readlimit - the maximum size of the complete request data as
int.| Method Detail |
public java.lang.String getName()
(DataSource implementation)
getName in interface javax.activation.DataSourcepublic java.lang.String getContentType()
(DataSource implementation)
Note:the String contains the parts border!
getContentType in interface javax.activation.DataSource
public java.io.InputStream getInputStream()
throws java.io.IOException
(DataSource implementation)
getInputStream in interface javax.activation.DataSourcejava.io.IOException - if impossible.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
(DataSource implementation)
getOutputStream in interface javax.activation.DataSourcejava.io.IOException - if impossible.
public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOException - if an I/O error occurs.
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
This method simply performs in.read(b, off, len) and returns the result.
read in class java.io.FilterInputStreamb - the buffer into which the data is read.off - the start offset of the data.len - the maximum number of bytes read.
java.io.IOException - if an I/O error occurs.FilterInputStream.in
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||