## org.w3c.www.mime
Class MultipartInputStream

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

public class MultipartInputStream
extends java.io.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 Summary
`MultipartInputStream(java.io.InputStream in, byte[] boundary)` Construct a new multipart input stream.

Method Summary
`int` | `available()`
`boolean` | `nextInputStream()` Switch to the next available part of data.
`int` | `read()` Read one byte of data from the current part.
`int` | `read(byte[] b, int off, int len)`
`long` | `skip(long n)`
`protected boolean` | `skipToBoundary()`

Methods inherited from class java.io.InputStream
`close, mark, markSupported, read, reset`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MultipartInputStream

    public MultipartInputStream(java.io.InputStream in,
                                byte[] boundary)

  Construct a new multipart input stream.
  Parameters:
    `in` - The initial (multipart) input stream.
    `boundary` - The input stream MIME boundary.

Method Detail

### skipToBoundary

    protected boolean skipToBoundary()
                              throws java.io.IOException

### read

    public int read()
             throws java.io.IOException

  Read one byte of data from the current part.
  Returns:
    A byte of data, or -1 if end of file.
  Throws:
    java.io.IOException - If some IO error occured.
  Overrides:
    read in class java.io.InputStream

### read

    public int read(byte[] b,
                    int off,
                    int len)
             throws java.io.IOException

  Overrides:
    read in class java.io.InputStream

### skip

    public long skip(long n)
              throws java.io.IOException

  Overrides:
    skip in class java.io.InputStream

### available

    public int available()
                  throws java.io.IOException

  Overrides:
    available in class java.io.InputStream

### nextInputStream

    public boolean nextInputStream()
                            throws java.io.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.