Package eu.bandm.tools.util
Class StreamsReadersWriters
java.lang.Object
eu.bandm.tools.util.StreamsReadersWriters
Collection of static convenience methods for frequently needed operations on
stream/reades/writers etc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Converts all characters read to lower or to upper. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Copy the contents of one file verbatim (on the level of byte io) into the other.static void
copyReaderWriter
(Reader in, Writer out) Copy the contents of the Reader verbatim (on the level of character io) into the writer.static void
copyStreams
(InputStream in, OutputStream out) Copy the contents of one stream verbatim (on the level of byte io) into the other.static void
copyToDocFiles
(String outputRootDir, String packageName, String filename) Copies an input file to a source text generator tool into thedoc-files
sub-directory of the output dir, into which the sources are generated.static String
readTextFileIntoString
(File input) Read the character contents of the given file into one (large) String value.static String
readTextFileIntoString
(InputStream stream) Read the character contents of the given stream into one (large) String value.static String
readTextFileIntoString
(Reader reader) Read the character contents of the character reader into one (large) String value.
-
Method Details
-
copyFiles
Copy the contents of one file verbatim (on the level of byte io) into the other.- Throws:
IOException
-
copyStreams
Copy the contents of one stream verbatim (on the level of byte io) into the other.- Throws:
IOException
-
copyReaderWriter
Copy the contents of the Reader verbatim (on the level of character io) into the writer.- Throws:
IOException
-
readTextFileIntoString
Read the character contents of the given file into one (large) String value.- Throws:
IOException
-
readTextFileIntoString
Read the character contents of the given stream into one (large) String value.- Throws:
IOException
-
readTextFileIntoString
Read the character contents of the character reader into one (large) String value.- Throws:
IOException
-
copyToDocFiles
public static void copyToDocFiles(String outputRootDir, String packageName, String filename) throws IOException Copies an input file to a source text generator tool into thedoc-files
sub-directory of the output dir, into which the sources are generated.- Parameters:
outputRootDir
- the directory into which all generated sources are stored by the tool. in sub-directories indicated by a non-empty package name.packageName
- the name of the generated package, indicates the sub-directory below outputRootDir.filename
- the name of the file to copy. The local part of the file is kept, the file system position is given by outputRootDir and packageName.- Throws:
IOException
-