Package ipsk.io
Class StreamCopy
- java.lang.Object
-
- ipsk.io.StreamCopy
-
public class StreamCopy extends java.lang.ObjectUtility methods to copy streams and files.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
Fields Modifier and Type Field Description static intDEF_BUF_SIZEstatic java.nio.charset.CharsetDEF_CHARSET
-
Constructor Summary
Constructors Constructor Description StreamCopy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidappend(java.io.InputStream is, java.io.OutputStream os)Reads data from input stream and appends it to the output stream.static voidcopy(java.io.File src, java.io.File dst)static voidcopy(java.io.File src, java.io.File dst, boolean createParentDirectories)static voidcopy(java.io.InputStream src, java.io.File dst, boolean createParentDirectories)static voidcopy(java.io.InputStream is, java.io.OutputStream os)Reads data from input stream and writes it to output stream.static voidcopy(java.io.InputStream is, java.io.OutputStream os, boolean closeOutStream)static voidcopy(java.io.InputStream is, java.io.OutputStream os, boolean closeOutStream, int bufSize)static voidcopy(java.io.InputStream is, java.io.OutputStream os, int bufSize)static voidcopyChars(java.io.Reader is, java.io.Writer os)static java.lang.StringreadTextFile(java.io.File textFile, java.nio.charset.Charset charset)static java.lang.StringreadTextStream(java.io.InputStream textStream, java.nio.charset.Charset charset)static voidtoSystemErr(java.io.InputStream is)static voidtoSystemOut(java.io.InputStream is)static voidwriteTextFile(java.lang.String text, java.io.File file, java.nio.charset.Charset charset)static voidwriteUTF8TextFile(java.lang.String text, java.io.File file)
-
-
-
Method Detail
-
copy
public static void copy(java.io.File src, java.io.File dst) throws java.io.IOException- Throws:
java.io.IOException
-
copy
public static void copy(java.io.File src, java.io.File dst, boolean createParentDirectories) throws java.io.IOException- Throws:
java.io.IOException
-
copy
public static void copy(java.io.InputStream src, java.io.File dst, boolean createParentDirectories) throws java.io.IOException- Throws:
java.io.IOException
-
append
public static void append(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOExceptionReads data from input stream and appends it to the output stream. Only the input stream is closed at end of input stream data.- Parameters:
is- input streamos- ouput stream- Throws:
java.io.IOException
-
copy
public static void copy(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOExceptionReads data from input stream and writes it to output stream. Input and output stream are closed at end of input stream data.- Parameters:
is-os-- Throws:
java.io.IOException
-
copy
public static void copy(java.io.InputStream is, java.io.OutputStream os, boolean closeOutStream) throws java.io.IOException- Throws:
java.io.IOException
-
copy
public static void copy(java.io.InputStream is, java.io.OutputStream os, int bufSize) throws java.io.IOException- Throws:
java.io.IOException
-
copy
public static void copy(java.io.InputStream is, java.io.OutputStream os, boolean closeOutStream, int bufSize) throws java.io.IOException- Throws:
java.io.IOException
-
copyChars
public static void copyChars(java.io.Reader is, java.io.Writer os) throws java.io.IOException- Throws:
java.io.IOException
-
writeUTF8TextFile
public static void writeUTF8TextFile(java.lang.String text, java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
writeTextFile
public static void writeTextFile(java.lang.String text, java.io.File file, java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
readTextStream
public static java.lang.String readTextStream(java.io.InputStream textStream, java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
readTextFile
public static java.lang.String readTextFile(java.io.File textFile, java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
toSystemOut
public static void toSystemOut(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
toSystemErr
public static void toSystemErr(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
-