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 EOLConvertingInputStream

    java.lang.Object
      java.io.InputStream
          org.apache.james.mime4j.io.EOLConvertingInputStream

All Implemented Interfaces:
  java.io.Closeable

    public class EOLConvertingInputStream

extends java.io.InputStream

InputStream which converts `\r` bytes not followed by `\n` and `\n` not preceded by `\r` to `\r\n`.

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

Field Summary
`static int` | `CONVERT_BOTH` Converts single '\r' and '\n' to '\r\n'
`static int` | `CONVERT_CR` Converts single '\r' to '\r\n'
`static int` | `CONVERT_LF` Converts single '\n' to '\r\n'

Constructor Summary
`EOLConvertingInputStream(java.io.InputStream in)` Creates a new `EOLConvertingInputStream` instance converting bytes in the given `InputStream`.
`EOLConvertingInputStream(java.io.InputStream in, int flags)` Creates a new `EOLConvertingInputStream` instance converting bytes in the given `InputStream`.

Method Summary
`void` | `close()` Closes the underlying stream.
`int` | `read()`

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

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

Field Detail

### CONVERT_CR

    public static final int CONVERT_CR

  Converts single '\r' to '\r\n'

  See Also:
    Constant Field Values

### CONVERT_LF

    public static final int CONVERT_LF

  Converts single '\n' to '\r\n'

  See Also:
    Constant Field Values

### CONVERT_BOTH

    public static final int CONVERT_BOTH

  Converts single '\r' and '\n' to '\r\n'

  See Also:
    Constant Field Values

Constructor Detail

### EOLConvertingInputStream

    public EOLConvertingInputStream(java.io.InputStream in)

  Creates a new `EOLConvertingInputStream` instance converting bytes in the given `InputStream`. The flag `CONVERT_BOTH` is the default.

  Parameters:
    `in` - the `InputStream` to read from.

### EOLConvertingInputStream

    public EOLConvertingInputStream(java.io.InputStream in,
                                    int flags)

  Creates a new `EOLConvertingInputStream` instance converting bytes in the given `InputStream`.

  Parameters:
    `in` - the `InputStream` to read from.
    `flags` - one of `CONVERT_CR`, `CONVERT_LF` or `CONVERT_BOTH`.

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.InputStream`
  Throws:
    `java.io.IOException` - on I/O errors.

### read

    public int read()
             throws java.io.IOException

  Specified by:
    `read` in class `java.io.InputStream`
  Throws:
    `java.io.IOException`
  See Also:
    `InputStream.read()`

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.