Class OutputStreamPrinter

java.lang.Object
java.io.Writer
org.exoplatform.commons.utils.Printer
org.exoplatform.commons.utils.OutputStreamPrinter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable, BinaryOutput

public class OutputStreamPrinter extends Printer implements BinaryOutput

An extension of Printer that encodes the text with a provided encoder and sends the resulting bytes on an OutputStream. The instance can be configured to have different behavior on failure of the output stream.

The ignoreOnFailure property will stop to make further invocations to the output stream if an exception is thrown by the output stream except for the close() method.

The failureFlow property modifies the control flow of the method invocation when the output stream throws an IOException.

The class provides direct write access to the underlying output stream when the client of the stream can provides bytes directly.

Version:
$Revision$
Author:
Julien Viet