org.apache.james.mime4j.decoder
Class LineBreakingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.apache.james.mime4j.decoder.LineBreakingOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class LineBreakingOutputStream
extends java.io.FilterOutputStream

This class take care of inserting a CRLF every lineLength bytes Default to 76 bytes lines. Please note that this does not check for existing newlines and simply adds CRLF every 76 bytes.


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
LineBreakingOutputStream(java.io.OutputStream out, int lineLength)
           
 
Method Summary
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineBreakingOutputStream

public LineBreakingOutputStream(java.io.OutputStream out,
                                int lineLength)
Method Detail

write

public final void write(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public final void write(int b)
                 throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException


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