public final class FileIOUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FileIOUtils.TransformingComparator
Decorates the given comparator and applies the function before delegating to the decorated
comparator.
|
| Modifier and Type | Method and Description |
|---|---|
static Comparator<String> |
lineBreakAwareComparator(Comparator<String> delegate)
Composing iterator which unescapes for line breaks and delegates to the given comparator.
|
static Set<String> |
readStringsAsSet(InputStream stream,
boolean unescape)
Reads strings from the given stream into a set and optionally unescaping for line breaks.
|
static void |
writeAsLine(BufferedWriter writer,
String str,
boolean escape)
Writes a string as a new line into the given buffered writer and optionally
escapes the line for line breaks.
|
static int |
writeStrings(Iterator<String> iterator,
File f,
boolean escape)
Writes string from the given iterator to the given file and optionally
escape the written strings for line breaks.
|
public static void writeAsLine(BufferedWriter writer, String str, boolean escape) throws IOException
writer - to write the stringstr - the string to writeescape - whether to escape string for line breaksIOExceptionpublic static int writeStrings(Iterator<String> iterator, File f, boolean escape) throws IOException
iterator - the source of the stringsf - file to write toescape - whether to escape for line breaksIOExceptionpublic static Set<String> readStringsAsSet(InputStream stream, boolean unescape) throws IOException
stream - the source of the stringsunescape - whether to unescape for line breaksIOExceptionpublic static Comparator<String> lineBreakAwareComparator(Comparator<String> delegate)
delegate - the actual comparison iteratorCopyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.