com.emarsys.ecommon.io
Class NewlineOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.emarsys.ecommon.io.NewlineOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class NewlineOutputStream
extends java.io.FilterOutputStream

Convert the various newline conventions to the local platform's newline convention.

This stream can be used with the Message.writeTo method to generate a message that uses the local plaform's line terminator for the purpose of (e.g.) saving the message to a local file.


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

Constructor Detail

NewlineOutputStream

public NewlineOutputStream(java.io.OutputStream os)
Method Detail

write

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

write

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

write

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


Copyright © 2010 emarsys AG. All Rights Reserved.