org.apache.geronimo.javamail.util
Class MIMEInputReader

java.lang.Object
  extended by java.io.Reader
      extended by org.apache.geronimo.javamail.util.MIMEInputReader
All Implemented Interfaces:
Closeable, Readable

public class MIMEInputReader
extends Reader

An implementation of an OutputStream that performs MIME linebreak canonicalization and "byte-stuff" so that data content does not get mistaken for a message data-end marker (CRLF.CRLF)l

Version:
$Rev: 597135 $ $Date: 2007-11-21 11:26:57 -0500 (Wed, 21 Nov 2007) $

Field Summary
protected  boolean atLineBreak
           
protected  boolean endOfData
           
protected  Reader source
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
MIMEInputReader(Reader source)
          Create an input reader that reads from the source input reader
 
Method Summary
 void close()
          Close the stream.
 int read(char[] buffer, int off, int len)
          Concrete implementation of the Reader read() abstract method.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected Reader source

atLineBreak

protected boolean atLineBreak

endOfData

protected boolean endOfData
Constructor Detail

MIMEInputReader

public MIMEInputReader(Reader source)
Create an input reader that reads from the source input reader

Parameters:
out - The wrapped Reader
Method Detail

read

public int read(char[] buffer,
                int off,
                int len)
         throws IOException
Concrete implementation of the Reader read() abstract method. This appears to be the only abstract method, so all of the other reads must funnel through this method.

Specified by:
read in class Reader
Parameters:
buffer - The buffer to fill.
off - The offset to start adding characters.
len - The number of requested characters.
Returns:
The actual count of characters read. Returns -1 if we hit an EOF without reading any characters.
Throws:
IOException

close

public void close()
           throws IOException
Close the stream. This is a NOP for this stream.

Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.