    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.

##

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

##

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

##

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.

##

skipToBoundary

     protected boolean skipToBoundary() throws IOException

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

read

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

  Overrides:
    read in class InputStream

skip

     public long skip(long n) throws IOException

  Overrides:
    skip in class InputStream

available

     public int available() throws IOException

  Overrides:
    available in class InputStream

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