public class StreamHelper
extends java.lang.Object
| Constructor and Description |
|---|
StreamHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFileToFile(java.io.File inFile,
java.io.File outFile)
This is a convenience routine to copy the contents of one file to another file.
|
static void |
copyFileToOutput(java.io.File file,
java.io.OutputStream os)
Given an output stream, copyFileToOutput will read the contents of a file
and stream those contents to the output stream until the entire file is sent.
|
static void |
copyFileToWriter(java.io.File file,
java.io.Writer w,
java.lang.String fileEncoding)
Given an output Writer object, copyFileToWriter will read the contents of a file
converting bytes to characters according to specified encoding, and stream those
characters to the Reader until the entire file is sent.
|
static void |
copyInputToOutput(java.io.InputStream is,
java.io.OutputStream os)
copyInputToOutput will read bytes from the input stream, and send them to the
output stream until the input stream is exhausted.
|
static void |
copyReaderToFile(java.io.Reader r,
java.io.File file,
java.lang.String encoding)
copyReaderToUTF8File will read the input Reader to the end, and write the
contents to the designated file using specified encoding, overwriting any
existing file that might be there.
|
static void |
copyReaderToUTF8File(java.io.Reader r,
java.io.File file)
copyReaderToUTF8File will read the input Reader to the end, and write the
contents to the designated file using UTF-8 encoding, overwriting any
existing file that might be there.
|
static void |
copyReaderToWriter(java.io.Reader r,
java.io.Writer w)
copyReaderToWriter will read character from the Reader, and send them to the
Writer until the Reader is exhausted.
|
static void |
copyStreamToFile(java.io.InputStream is,
java.io.File file)
copyStreamToFile will read the input stream to the end, and write the
contents to the designated file.
|
static void |
copyUTF8FileToWriter(java.io.File file,
java.io.Writer w)
Given an output Writer object, copyUTF8FileToWriter will read the contents of a file
converting bytes to characters according to UTF-8 encoding, and stream those
characters to the Reader until the entire file is sent.
|
public static void copyReaderToWriter(java.io.Reader r,
java.io.Writer w)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyInputToOutput(java.io.InputStream is,
java.io.OutputStream os)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyFileToOutput(java.io.File file,
java.io.OutputStream os)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyFileToWriter(java.io.File file,
java.io.Writer w,
java.lang.String fileEncoding)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyUTF8FileToWriter(java.io.File file,
java.io.Writer w)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyStreamToFile(java.io.InputStream is,
java.io.File file)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyReaderToUTF8File(java.io.Reader r,
java.io.File file)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyReaderToFile(java.io.Reader r,
java.io.File file,
java.lang.String encoding)
throws java.lang.Exception
java.lang.Exceptionpublic static void copyFileToFile(java.io.File inFile,
java.io.File outFile)
throws java.lang.Exception
java.lang.Exception