public final class IOUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
readFile(File file)
Read a file and return the content as string assuming UTF8.
|
static String |
readInput(InputStream in)
Read an input stream and return the content as string assuming UTF8.
|
static byte[] |
readInputStream(InputStream in) |
static void |
readInputStream(InputStream in,
byte[] buf) |
static void |
writeFile(String content,
File file)
Write a file with the content assuming UTF8.
|
public static byte[] readInputStream(InputStream in) throws IOException
IOExceptionpublic static void readInputStream(InputStream in, byte[] buf) throws IOException
IOExceptionpublic static String readInput(InputStream in) throws IOException
in - The input streamIOException - epublic static String readFile(File file) throws IOException
file - The file to readIOException - epublic static void writeFile(String content, File file) throws IOException
content - The contentfile - The file to writeIOException - eCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.