All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.mime.MultipartInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----w3c.www.mime.MultipartInputStream

public class MultipartInputStream
extends InputStream
A class to handle multipart MIME input streams. See RC 1521. This class handles multipart input streams, as defined by the RFC 1521. It prvides a sequential interface to all MIME parts, and for each part it delivers a suitable InputStream for getting its body.


Constructor Index

 o MultipartInputStream(InputStream, byte[])
Construct a new multipart input stream.

Method Index

 o available()
 o nextInputStream()
Switch to the next available part of data.
 o read()
Read one byte of data from the current part.
 o read(byte[], int, int)
 o skip(long)
 o skipToBoundary()

Constructors

 o MultipartInputStream
 public MultipartInputStream(InputStream in,
                             byte boundary[])
Construct a new multipart input stream.

Parameters:
in - The initial (multipart) input stream.
boundary - The input stream MIME boundary.

Methods

 o skipToBoundary
 protected boolean skipToBoundary() throws IOException
 o read
 public int read() throws IOException
Read one byte of data from the current part.

Returns:
A byte of data, or -1 if end of file.
Throws: IOException
If some IO error occured.
Overrides:
read in class InputStream
 o read
 public int read(byte b[],
                 int off,
                 int len) throws IOException
Overrides:
read in class InputStream
 o skip
 public long skip(long n) throws IOException
Overrides:
skip in class InputStream
 o available
 public int available() throws IOException
Overrides:
available in class InputStream
 o nextInputStream
 public boolean nextInputStream() throws IOException
Switch to the next available part of data. One can interrupt the current part, and use this method to switch to next part before current part was totally read.

Returns:
A boolean true if there next partis ready, or false if this was the last part.

All Packages  Class Hierarchy  This Package  Previous  Next  Index