Package org.parboiled.common
Class FileUtils
- java.lang.Object
-
- org.parboiled.common.FileUtils
-
public final class FileUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyAll(InputStream in, OutputStream out)
static void
copyAll(Reader reader, Writer writer)
static void
ensureParentDir(File file)
static void
ensureParentDir(String filename)
static void
forceMkdir(File directory)
static byte[]
readAllBytes(File file)
static byte[]
readAllBytes(InputStream stream)
static byte[]
readAllBytes(String filename)
static byte[]
readAllBytesFromResource(String resource)
static char[]
readAllChars(File file)
static char[]
readAllChars(File file, Charset charset)
static char[]
readAllChars(InputStream stream)
static char[]
readAllChars(InputStream stream, Charset charset)
static char[]
readAllChars(String filename)
static char[]
readAllChars(String filename, Charset charset)
static char[]
readAllCharsFromResource(String resource)
static char[]
readAllCharsFromResource(String resource, Charset charset)
static String
readAllText(File file)
static String
readAllText(File file, Charset charset)
static String
readAllText(InputStream stream)
static String
readAllText(InputStream stream, Charset charset)
static String
readAllText(String filename)
static String
readAllText(String filename, Charset charset)
static String
readAllTextFromResource(String resource)
static String
readAllTextFromResource(String resource, Charset charset)
static void
writeAllBytes(byte[] data, File file)
static void
writeAllBytes(byte[] data, OutputStream stream)
static void
writeAllBytes(byte[] data, String filename)
static void
writeAllChars(char[] chars, File file)
static void
writeAllChars(char[] chars, File file, Charset charset)
static void
writeAllChars(char[] chars, OutputStream stream)
static void
writeAllChars(char[] chars, OutputStream stream, Charset charset)
static void
writeAllChars(char[] chars, String filename)
static void
writeAllChars(char[] chars, String filename, Charset charset)
static void
writeAllText(String text, File file)
static void
writeAllText(String text, File file, Charset charset)
static void
writeAllText(String text, OutputStream stream)
static void
writeAllText(String text, OutputStream stream, Charset charset)
static void
writeAllText(String text, String filename)
static void
writeAllText(String text, String filename, Charset charset)
-
-
-
Method Detail
-
readAllTextFromResource
public static String readAllTextFromResource(String resource, Charset charset)
-
readAllText
public static String readAllText(InputStream stream)
-
readAllText
public static String readAllText(InputStream stream, Charset charset)
-
readAllCharsFromResource
public static char[] readAllCharsFromResource(String resource)
-
readAllCharsFromResource
public static char[] readAllCharsFromResource(String resource, Charset charset)
-
readAllChars
public static char[] readAllChars(String filename)
-
readAllChars
public static char[] readAllChars(File file)
-
readAllChars
public static char[] readAllChars(InputStream stream)
-
readAllChars
public static char[] readAllChars(InputStream stream, Charset charset)
-
readAllBytesFromResource
public static byte[] readAllBytesFromResource(String resource)
-
readAllBytes
public static byte[] readAllBytes(String filename)
-
readAllBytes
public static byte[] readAllBytes(File file)
-
readAllBytes
public static byte[] readAllBytes(InputStream stream)
-
writeAllText
public static void writeAllText(String text, OutputStream stream)
-
writeAllText
public static void writeAllText(String text, OutputStream stream, Charset charset)
-
writeAllChars
public static void writeAllChars(char[] chars, String filename)
-
writeAllChars
public static void writeAllChars(char[] chars, File file)
-
writeAllChars
public static void writeAllChars(char[] chars, OutputStream stream)
-
writeAllChars
public static void writeAllChars(char[] chars, OutputStream stream, Charset charset)
-
writeAllBytes
public static void writeAllBytes(byte[] data, String filename)
-
writeAllBytes
public static void writeAllBytes(byte[] data, File file)
-
writeAllBytes
public static void writeAllBytes(byte[] data, OutputStream stream)
-
copyAll
public static void copyAll(InputStream in, OutputStream out)
-
ensureParentDir
public static void ensureParentDir(String filename)
-
ensureParentDir
public static void ensureParentDir(File file)
-
forceMkdir
public static void forceMkdir(File directory) throws IOException
- Throws:
IOException
-
-