org.objectweb.util.monolog.wrapper.common

Class OutputStreamSwitcher


public class OutputStreamSwitcher
extends OutputStream

This Outstream implementation permits to switch the outStream at any time. It is interesting to switch between System.out and System.err dependeing on the message level.

Author:
S.Chassande-Barrioz

Field Summary

protected OutputStream
currentOut

Constructor Summary

OutputStreamSwitcher()
OutputStreamSwitcher(OutputStream defaultOut)

Method Summary

void
close()
void
flush()
void
switchOutput(OutputStream newOut)
void
write(b[] )
void
write(b[] , int off, int len)
void
write(int b)

Field Details

currentOut

protected OutputStream currentOut

Constructor Details

OutputStreamSwitcher

public OutputStreamSwitcher()


OutputStreamSwitcher

public OutputStreamSwitcher(OutputStream defaultOut)

Method Details

close

public void close()
            throws IOException


flush

public void flush()
            throws IOException


switchOutput

public void switchOutput(OutputStream newOut)


write

public void write(b[] )
            throws IOException


write

public void write(b[] ,
                  int off,
                  int len)
            throws IOException


write

public void write(int b)
            throws IOException