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