public class IO extends Object
| Constructor and Description |
|---|
IO() |
| Modifier and Type | Method and Description |
|---|---|
static String |
fromFile(File input,
boolean hasNewLine)
Read the entire file as a string
|
static String |
fromFile(String source)
Read the entire file as a String
|
static String |
fromFile(String source,
boolean hasNewLine)
Read the entire file as a string.
|
static Iterator<String> |
linesFromFile(File source)
Read the file as an Iterator<String> with each line as an item.
|
static Iterator<String> |
linesFromFile(String source)
Read the file as an Iterator<String> with each line as an item.
|
static Iterator<String> |
linesFromInputStream(InputStream source)
Read the file as an Iterator<String> with each line as an item.
|
public static String fromFile(String source) throws IOException
source - IOExceptionpublic static String fromFile(String source, boolean hasNewLine) throws IOException
source - hasNewLine - Should we maintain the \n in the final string?IOExceptionpublic static String fromFile(File input, boolean hasNewLine) throws IOException
input - hasNewLine - IOExceptionpublic static Iterator<String> linesFromFile(String source) throws IOException
source - IOExceptionpublic static Iterator<String> linesFromFile(File source) throws IOException
source - IOExceptionpublic static Iterator<String> linesFromInputStream(InputStream source) throws IOException
source - IOExceptionCopyright © 2016. All rights reserved.