public class IOUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IOUtil.ReadException |
static class |
IOUtil.WrappedException |
static class |
IOUtil.WriteException |
Modifier and Type | Field and Description |
---|---|
static OutputStream |
BlackHoleOutputStream |
static int |
DEFAULT_COPY_BUFFER_SIZE |
static InputStream |
EmptyInputStream |
Constructor and Description |
---|
IOUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeInput(InputStream in)
Closes the given input stream and ignores the IOException.
|
static void |
closeInput(Reader in)
Closes the given Reader and ignores the IOException.
|
static void |
closeQuietly(Closeable obj) |
void |
copyFileToStream(File fin,
OutputStream out) |
void |
copyFileToStream(File fin,
OutputStream out,
int copyBufferSize) |
void |
copyStreamToFile(InputStream in,
File fout) |
void |
copyStreamToFile(InputStream in,
File fout,
int copyBufferSize) |
static void |
copyStreamToStream(InputStream in,
OutputStream out) |
static void |
copyStreamToStream(InputStream in,
OutputStream out,
byte[] copyBuffer) |
static void |
copyStreamToStream(InputStream in,
OutputStream out,
int copyBufferSize) |
static InputStream |
limit(InputStream in,
long limit) |
static byte[] |
slurp(InputStream in,
int byteLimit) |
static byte[] |
slurp(InputStream in,
int byteLimit,
byte[] slurpBuffer) |
static String |
toUtf8String(InputStream in) |
static Reader |
utf8Reader(InputStream in) |
static Writer |
utf8Writer(OutputStream out) |
public static final int DEFAULT_COPY_BUFFER_SIZE
public static final InputStream EmptyInputStream
public static final OutputStream BlackHoleOutputStream
public static Reader utf8Reader(InputStream in)
public static Writer utf8Writer(OutputStream out)
public static String toUtf8String(InputStream in) throws IOUtil.ReadException, CharacterCodingException
public static void copyStreamToStream(InputStream in, OutputStream out) throws IOUtil.ReadException, IOUtil.WriteException
public static void copyStreamToStream(InputStream in, OutputStream out, byte[] copyBuffer) throws IOUtil.ReadException, IOUtil.WriteException
public static void copyStreamToStream(InputStream in, OutputStream out, int copyBufferSize) throws IOUtil.ReadException, IOUtil.WriteException
public static byte[] slurp(InputStream in, int byteLimit) throws IOException
IOException
public static byte[] slurp(InputStream in, int byteLimit, byte[] slurpBuffer) throws IOException
IOException
public void copyFileToStream(File fin, OutputStream out) throws IOUtil.ReadException, IOUtil.WriteException
public void copyFileToStream(File fin, OutputStream out, int copyBufferSize) throws IOUtil.ReadException, IOUtil.WriteException
public void copyStreamToFile(InputStream in, File fout) throws IOUtil.ReadException, IOUtil.WriteException
public void copyStreamToFile(InputStream in, File fout, int copyBufferSize) throws IOUtil.ReadException, IOUtil.WriteException
public static void closeInput(InputStream in)
public static void closeInput(Reader in)
public static void closeQuietly(Closeable obj)
public static InputStream limit(InputStream in, long limit)