edu.umd.cfar.lamp.apploader.misc
Class TargetedPrintStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.PrintStream
              extended byedu.umd.cfar.lamp.apploader.misc.TargetedPrintStream

public class TargetedPrintStream
extends java.io.PrintStream

A printstream to a file. This is designed to redirect the system streams to a file, while still printing out the system stream to the console.


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
TargetedPrintStream(java.io.PrintStream original, java.io.OutputStream out)
          Constructs a new two-target output stream.
TargetedPrintStream(java.io.PrintStream original, java.io.OutputStream out, boolean autoFlush)
          Constructs a new two-target output stream.
TargetedPrintStream(java.io.PrintStream original, java.io.OutputStream out, boolean autoFlush, java.lang.String encoding)
           
 
Method Summary
 boolean checkError()
           
 void close()
           
 boolean equals(java.lang.Object arg0)
           
 void flush()
           
 java.io.PrintStream getOriginal()
          Gets the original stream.
 int hashCode()
           
 void print(boolean arg0)
           
 void print(char arg0)
           
 void print(char[] arg0)
           
 void print(double arg0)
           
 void print(float arg0)
           
 void print(int arg0)
           
 void print(long arg0)
           
 void print(java.lang.Object arg0)
           
 void print(java.lang.String arg0)
           
 void println()
           
 void println(boolean arg0)
           
 void println(char arg0)
           
 void println(char[] arg0)
           
 void println(double arg0)
           
 void println(float arg0)
           
 void println(int arg0)
           
 void println(long arg0)
           
 void println(java.lang.Object arg0)
           
 void println(java.lang.String arg0)
           
 void write(byte[] arg0)
           
 void write(byte[] arg0, int arg1, int arg2)
           
 void write(int arg0)
           
 
Methods inherited from class java.io.PrintStream
setError
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetedPrintStream

public TargetedPrintStream(java.io.PrintStream original,
                           java.io.OutputStream out)
Constructs a new two-target output stream.

Parameters:
original - the original stream
out - the secondary stream

TargetedPrintStream

public TargetedPrintStream(java.io.PrintStream original,
                           java.io.OutputStream out,
                           boolean autoFlush)
Constructs a new two-target output stream.

Parameters:
original - the original stream
out - the secondary stream
autoFlush - sets the autoflush option on the secondary stream

TargetedPrintStream

public TargetedPrintStream(java.io.PrintStream original,
                           java.io.OutputStream out,
                           boolean autoFlush,
                           java.lang.String encoding)
                    throws java.io.UnsupportedEncodingException
Parameters:
original - the original output stream
out - where to send output
autoFlush - to flush the buffer after every write method call
encoding - a supported character encoding
Throws:
java.io.UnsupportedEncodingException
Method Detail

checkError

public boolean checkError()

close

public void close()

equals

public boolean equals(java.lang.Object arg0)

flush

public void flush()

hashCode

public int hashCode()

print

public void print(boolean arg0)

print

public void print(char arg0)

print

public void print(char[] arg0)

print

public void print(double arg0)

print

public void print(float arg0)

print

public void print(int arg0)

print

public void print(java.lang.Object arg0)

print

public void print(java.lang.String arg0)

print

public void print(long arg0)

println

public void println()

println

public void println(boolean arg0)

println

public void println(char arg0)

println

public void println(char[] arg0)

println

public void println(double arg0)

println

public void println(float arg0)

println

public void println(int arg0)

println

public void println(java.lang.Object arg0)

println

public void println(java.lang.String arg0)

println

public void println(long arg0)

write

public void write(byte[] arg0)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] arg0,
                  int arg1,
                  int arg2)

write

public void write(int arg0)

getOriginal

public java.io.PrintStream getOriginal()
Gets the original stream.

Returns: