com.sun.jini.mercury
Class EventWriter.SwitchOutputStream
java.lang.Object
java.io.OutputStream
com.sun.jini.mercury.EventWriter.SwitchOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
- Enclosing class:
- EventWriter
private static class EventWriter.SwitchOutputStream
- extends OutputStream
This class is intended to be the OutputStream provided
to EventOutputStream's constructor. This class essentially
delegates OutputStream functionality to the provided
LogOutputStream. The setOutputStream method
allows the underlying LogOutputStream to be re-targeted
at runtime.
Field Summary |
private LogOutputStream |
out
The delegation target for the OutputStream methods |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
private LogOutputStream out
- The delegation target for the OutputStream methods
EventWriter.SwitchOutputStream
public EventWriter.SwitchOutputStream(LogOutputStream out)
- Simple constructor that assigns the given argument to the
appropriate internal field.
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException
setOutputStream
public void setOutputStream(LogOutputStream out)
- Sets the delegation target
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.