public class FileFunctions
extends java.lang.Object
| Constructor and Description |
|---|
FileFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String... args)
This method is called when executing this sample application from the
command line.
|
static byte[] |
readFile(java.lang.String fileName)
Read a file into a byte array.
|
static java.lang.String |
readTextFile(java.lang.String fileName)
Read a String from a file.
|
static java.lang.String |
readTextFileWithEncoding(java.lang.String fileName,
java.lang.String encoding)
Read a String from a file using the specified encoding.
|
public static void main(java.lang.String... args)
throws java.lang.Exception
args - the command line parametersjava.lang.Exceptionpublic static java.lang.String readTextFile(java.lang.String fileName)
throws java.io.IOException
fileName - the file namejava.io.IOExceptionpublic static java.lang.String readTextFileWithEncoding(java.lang.String fileName,
java.lang.String encoding)
throws java.io.IOException
fileName - the file nameencoding - the encodingjava.io.IOExceptionpublic static byte[] readFile(java.lang.String fileName)
throws java.io.IOException
fileName - the file namejava.io.IOException