public final class IoUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
IoUtils.CopyListener
Listener and controller for copy process
|
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CONTINUE_LOADING_PERCENTAGE
75
|
static int |
DEFAULT_BUFFER_SIZE
32768
|
static int |
DEFAULT_IMAGE_TOTAL_SIZE
512000
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closeSilently(Closeable closeable) |
static boolean |
copyStream(InputStream is,
OutputStream os,
IoUtils.CopyListener listener)
Copies stream, fires progress events by listener, can be interrupted by listener.
|
static boolean |
copyStream(InputStream is,
OutputStream os,
IoUtils.CopyListener listener,
int bufferSize)
Copies stream, fires progress events by listener, can be interrupted by listener.
|
static void |
readAndCloseStream(InputStream is)
Reads all data from stream and close it silently
|
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_IMAGE_TOTAL_SIZE
public static final int CONTINUE_LOADING_PERCENTAGE
public static boolean copyStream(InputStream is, OutputStream os, IoUtils.CopyListener listener) throws IOException
is - Input streamos - Output streamlistener - null-ok; Listener of copying progress and controller of copying interruptingIOExceptionpublic static boolean copyStream(InputStream is, OutputStream os, IoUtils.CopyListener listener, int bufferSize) throws IOException
is - Input streamos - Output streamlistener - null-ok; Listener of copying progress and controller of copying interruptingbufferSize - Buffer size for copying, also represents a step for firing progress listener callback, i.e.
progress event will be fired after every copied bufferSize bytesIOExceptionpublic static void readAndCloseStream(InputStream is)
is - Input streampublic static void closeSilently(Closeable closeable)