| java.lang.Object java.io.InputStream java.io.FilterInputStream dtw.webmail.util.MultipartInputStream
MultipartInputStream | public class MultipartInputStream extends FilterInputStream implements DataSource(Code) | | 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.
author: Dieter Wimberger version: 0.9.7 07/02/2003 |
Constructor Summary | |
public | MultipartInputStream(InputStream in, String ctype, int readlimit) Constructs a MultipartInputStream instance.
Parameters: in - the InputStream this instance reads from. Parameters: ctype - the content type of the incoming request as String. |
Method Summary | |
public String | getContentType() Returns the content type of this instance as
String. | public InputStream | getInputStream() Returns this MultipartInputStream instance as
InputStream. | public String | getName() Returns the name of this instance as String. | public OutputStream | getOutputStream() Throws an IOException in this implementation, because
this instance represents a read-only DataSource. | public int | read() Reads the next byte of data from the input stream. | public int | read(byte b, int off, int len) Reads up to len bytes of data from this input stream
into an array of bytes. |
MultipartInputStream | public MultipartInputStream(InputStream in, String ctype, int readlimit)(Code) | | Constructs a MultipartInputStream instance.
Parameters: in - the InputStream this instance reads from. Parameters: ctype - the content type of the incoming request as String. Important because it contains the parts border! Parameters: readlimit - the maximum size of the complete request data asint. the newly created MultipartInputStream instance. |
getContentType | public String getContentType()(Code) | | Returns the content type of this instance as
String.
(DataSource implementation)
Note:the String contains the parts border!
the content type as String |
getInputStream | public InputStream getInputStream() throws IOException(Code) | | Returns this MultipartInputStream instance as
InputStream.
(DataSource implementation)
this instance as InputStream. throws: IOException - if impossible. |
getName | public String getName()(Code) | | Returns the name of this instance as String.
(DataSource implementation)
the name as String |
getOutputStream | public OutputStream getOutputStream() throws IOException(Code) | | Throws an IOException in this implementation, because
this instance represents a read-only DataSource.
(DataSource implementation)
an OutputStream instance for writingto this DataSource. throws: IOException - if impossible. |
read | public int read() throws IOException(Code) | | Reads the next byte of data from the input stream. The value byte is
returned as an int in the range 0 to
255. If no byte is available because the end of the stream
has been reached, the value -1 is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
the next byte of data, or -1 if the end of thestream is reached. exception: IOException - if an I/O error occurs. |
read | public int read(byte b, int off, int len) throws IOException(Code) | | Reads up to len bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available.
This method simply performs in.read(b, off, len)
and returns the result.
Parameters: b - the buffer into which the data is read. Parameters: off - the start offset of the data. Parameters: len - the maximum number of bytes read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached. exception: IOException - if an I/O error occurs. See Also: java.io.FilterInputStream.in |
|
|