public class TextIO
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
read(java.io.File f)
Read text file f and return it as a String.
|
static java.lang.String[] |
readToArray(java.io.File f)
Read text file f and return it with one line in each array element.
|
static void |
write(java.io.File f,
java.lang.String s)
Write s to text file f.
|
static void |
write(java.lang.String f,
java.lang.String s)
Write s to text file f.
|
public static void write(java.lang.String f, java.lang.String s) throws java.io.IOException
f
- - a file path to write tos
- - text to writejava.io.IOException
public static void write(java.io.File f, java.lang.String s) throws java.io.IOException
f
- - a file to write tos
- - text to write to the file f.java.io.IOException
public static java.lang.String read(java.io.File f) throws java.io.IOException
f
- - the File to readjava.io.IOException
- - if the file reading goes bad.public static java.lang.String[] readToArray(java.io.File f) throws java.io.IOException
f
- - the File to readjava.io.IOException
- - if the file reading goes bad.