Package patterntesting.runtime.io
Class BetterFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FileInputStream
-
- patterntesting.runtime.io.BetterFileInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public final class BetterFileInputStream extends java.io.FileInputStream
Whenever you need aFileInputStream
and want a better toString implementation you can use the class BetterFileInputStream. "Better" means that you see the name if the input file in the log which is much more helpful than the default implementation ofObject.toString()
, especially for logging and debugging.- Since:
- 1.3.1 (14.09.2013)
- Author:
- oliver (boehm@javatux.de)
- See Also:
FileInputStream
-
-
Constructor Summary
Constructors Constructor Description BetterFileInputStream(java.io.File file)
Instantiates a new better file input stream.BetterFileInputStream(java.lang.String name)
Instantiates a new better file input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
This toString implementation reports the name of the input file which is much more helpful than the default implementation ofObject.toString()
, especially for logging and debugging.-
Methods inherited from class java.io.FileInputStream
available, close, finalize, getChannel, getFD, read, read, read, skip
-
-
-
-
Constructor Detail
-
BetterFileInputStream
public BetterFileInputStream(java.lang.String name) throws java.io.FileNotFoundException
Instantiates a new better file input stream.- Parameters:
name
- the name- Throws:
java.io.FileNotFoundException
- the file not found exception- See Also:
FileInputStream(String)
-
BetterFileInputStream
public BetterFileInputStream(java.io.File file) throws java.io.FileNotFoundException
Instantiates a new better file input stream.- Parameters:
file
- the file- Throws:
java.io.FileNotFoundException
- the file not found exception- See Also:
FileInputStream(File)
-
-
Method Detail
-
toString
public java.lang.String toString()
This toString implementation reports the name of the input file which is much more helpful than the default implementation ofObject.toString()
, especially for logging and debugging.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
- See Also:
Object.toString()
-
-