@UtilityMarker public final class IOUtility extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(Reader reader,
Writer writer)
Reads the stream fully, and writes to the writer.
|
static Path |
createTempFilePath(String stem,
String extension) |
static String |
getFileExtension(Path file) |
static String |
getFileExtension(String fileName) |
static boolean |
isFileReadable(Path file)
Checks if an input file can be read.
|
static boolean |
isFileWritable(Path file)
Checks if an output file can be written.
|
static String |
readFully(InputStream stream) |
static String |
readFully(Reader reader)
Reads the stream fully, and returns a byte array of data.
|
static String |
readResourceFully(String resource) |
public static void copy(Reader reader, Writer writer)
reader - Reader to read.writer - Writer to copy topublic static Path createTempFilePath(String stem, String extension) throws IOException
IOExceptionpublic static boolean isFileReadable(Path file)
file - Input file to readpublic static boolean isFileWritable(Path file)
file - Output file to writepublic static String readFully(InputStream stream)
public static String readFully(Reader reader)
reader - Reader to read.Copyright © 2000-2022 Sualeh Fatehi. All rights reserved.