patterntesting.runtime.io
Class BetterFileOutputStream

Package class diagram package BetterFileOutputStream
java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FileOutputStream
          extended by patterntesting.runtime.io.BetterFileOutputStream
All Implemented Interfaces:
Closeable, Flushable

public final class BetterFileOutputStream
extends FileOutputStream

Whenever you need a FileOutputStream and want a better toString implementation you can use the class BetterFileOutputStream. "Better" means that you see the name if the input file in the log which is much more helpful than the default implementation of Object.toString(), especially for logging and debugging.

Since:
1.3.1 (14.09.2013)
Author:
oliver (boehm@javatux.de)
See Also:
FileOutputStream

Constructor Summary
BetterFileOutputStream(File file)
          Instantiates a new better file output stream.
BetterFileOutputStream(File file, boolean append)
          Instantiates a new better file output stream.
BetterFileOutputStream(String name)
          Instantiates a new better file output stream.
BetterFileOutputStream(String name, boolean append)
          Instantiates a new better file output stream.
 
Method Summary
 String toString()
          This toString implementation reports the name of the output file which is much more helpful than the default implementation of Object.toString(), especially for logging and debugging.
 
Methods inherited from class java.io.FileOutputStream
close, finalize, getChannel, getFD, write, write, write
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetterFileOutputStream

public BetterFileOutputStream(String name)
                       throws FileNotFoundException
Instantiates a new better file output stream.

Parameters:
name - the file name
Throws:
FileNotFoundException - the file not found exception
See Also:
FileOutputStream.FileOutputStream(String)

BetterFileOutputStream

public BetterFileOutputStream(File file)
                       throws FileNotFoundException
Instantiates a new better file output stream.

Parameters:
file - the file
Throws:
FileNotFoundException - the file not found exception
See Also:
FileOutputStream.FileOutputStream(File)

BetterFileOutputStream

public BetterFileOutputStream(String name,
                              boolean append)
                       throws FileNotFoundException
Instantiates a new better file output stream.

Parameters:
name - the file name
append - if it should be appended
Throws:
FileNotFoundException - the file not found exception
See Also:
FileOutputStream.FileOutputStream(String,boolean)

BetterFileOutputStream

public BetterFileOutputStream(File file,
                              boolean append)
                       throws FileNotFoundException
Instantiates a new better file output stream.

Parameters:
file - the file
append - if it should be appended
Throws:
FileNotFoundException - the file not found exception
See Also:
FileOutputStream.FileOutputStream(File,boolean)
Method Detail

toString

public String toString()
This toString implementation reports the name of the output file which is much more helpful than the default implementation of Object.toString(), especially for logging and debugging.

Overrides:
toString in class Object
Returns:
the string
See Also:
Object.toString()


Copyright © 2002–2014 PatternTesting Team. All rights reserved.