public final class IoUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
IoUtils.CopyListener
Listener and controller for copy process
|
Modifier and Type | Field and Description |
---|---|
static int |
CONTINUE_LOADING_PERCENTAGE
75
|
static int |
DEFAULT_BUFFER_SIZE
32768
|
static int |
DEFAULT_IMAGE_TOTAL_SIZE
512000
|
Modifier and Type | Method and Description |
---|---|
static void |
closeSilently(java.io.Closeable closeable) |
static boolean |
copyStream(java.io.InputStream is,
java.io.OutputStream os,
IoUtils.CopyListener listener)
Copies stream, fires progress events by listener, can be interrupted by listener.
|
static boolean |
copyStream(java.io.InputStream is,
java.io.OutputStream os,
IoUtils.CopyListener listener,
int bufferSize)
Copies stream, fires progress events by listener, can be interrupted by listener.
|
static void |
readAndCloseStream(java.io.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(java.io.InputStream is, java.io.OutputStream os, IoUtils.CopyListener listener) throws java.io.IOException
is
- Input streamos
- Output streamlistener
- null-ok; Listener of copying progress and controller of copying interruptingjava.io.IOException
public static boolean copyStream(java.io.InputStream is, java.io.OutputStream os, IoUtils.CopyListener listener, int bufferSize) throws java.io.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 bytesjava.io.IOException
public static void readAndCloseStream(java.io.InputStream is)
is
- Input streampublic static void closeSilently(java.io.Closeable closeable)