Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.james.mime4j.io
Class MimeBoundaryInputStream

    java.lang.Object
      java.io.InputStream
          java.io.FilterInputStream
              org.apache.james.mime4j.io.LineReaderInputStream
                  org.apache.james.mime4j.io.MimeBoundaryInputStream

All Implemented Interfaces:
  java.io.Closeable

    public class MimeBoundaryInputStream

extends LineReaderInputStream

Stream that constrains itself to a single MIME body part. After the stream ends (i.e. read() returns -1) `isLastPart()` can be used to determine if a final boundary has been seen or not.

Version:
  $Id: MimeBoundaryInputStream.java,v 1.2 2004/11/29 13:15:42 ntherning Exp $

Field Summary

Fields inherited from class java.io.FilterInputStream
`in`

Constructor Summary
`MimeBoundaryInputStream(BufferedLineReaderInputStream inbuffer, java.lang.String boundary)` Creates a new MimeBoundaryInputStream.

Method Summary
`void` | `close()` Closes the underlying stream.
`boolean` | `eof()`
`boolean` | `isLastPart()`
`boolean` | `markSupported()`
`int` | `read()`
`int` | `read(byte[] b, int off, int len)`
`int` | `readLine(ByteArrayBuffer dst)` Reads one line of text into the given `ByteArrayBuffer`.
`java.lang.String` | `toString()`

Methods inherited from class java.io.FilterInputStream
`available, mark, read, reset, skip`

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

Constructor Detail

### MimeBoundaryInputStream

    public MimeBoundaryInputStream(BufferedLineReaderInputStream inbuffer,
                                   java.lang.String boundary)
                            throws java.io.IOException

  Creates a new MimeBoundaryInputStream.

  Parameters:
    `inbuffer` - The underlying stream.
    `boundary` - Boundary string (not including leading hyphens).
  Throws:
    `java.lang.IllegalArgumentException` - when boundary is too long
    `java.io.IOException`

Method Detail

### close

    public void close()
               throws java.io.IOException

  Closes the underlying stream.

  Specified by:
    `close` in interface `java.io.Closeable`
  Overrides:
    `close` in class `java.io.FilterInputStream`
  Throws:
    `java.io.IOException` - on I/O errors.

### markSupported

    public boolean markSupported()

  Overrides:
    `markSupported` in class `java.io.FilterInputStream`
  See Also:
    `InputStream.markSupported()`

### read

    public int read()
             throws java.io.IOException

  Overrides:
    `read` in class `java.io.FilterInputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `InputStream.read()`

### read

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

  Overrides:
    `read` in class `java.io.FilterInputStream`
  Throws:
    `java.io.IOException`

### readLine

    public int readLine(ByteArrayBuffer dst)
                 throws java.io.IOException

  Description copied from class: `LineReaderInputStream`
  Reads one line of text into the given `ByteArrayBuffer`.

  Specified by:
    `readLine` in class `LineReaderInputStream`
  Parameters:
    `dst` - Destination
  Returns:
    number of bytes copied or `-1` if the end of the stream has been reached.
  Throws:
    `java.io.IOException` - in case of an I/O error.

### isLastPart

    public boolean isLastPart()

### eof

    public boolean eof()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.