public class IOUtilities extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
IOUtilities.TransferCallback |
Modifier and Type | Method and Description |
---|---|
static void |
close(Closeable c) |
static void |
compressBytes(ByteArrayOutputStream original,
ByteArrayOutputStream compressed) |
static void |
flush(Flushable f) |
static InputStream |
getInputStream(URLConnection c) |
static byte[] |
inputStreamToBytes(InputStream in)
Convert InputStream contents to a byte[].
|
static void |
transfer(File file,
OutputStream out) |
static void |
transfer(File f,
URLConnection c,
IOUtilities.TransferCallback cb) |
static void |
transfer(InputStream in,
byte[] bytes)
Use this when you expect a byte[] length of bytes to be read from the InputStream
|
static void |
transfer(InputStream s,
File f,
IOUtilities.TransferCallback cb) |
static void |
transfer(InputStream in,
OutputStream out)
Transfers bytes from an input stream to an output stream.
|
static void |
transfer(InputStream in,
OutputStream out,
IOUtilities.TransferCallback cb)
Transfers bytes from an input stream to an output stream.
|
static void |
transfer(URLConnection c,
File f,
IOUtilities.TransferCallback cb) |
public static InputStream getInputStream(URLConnection c) throws IOException
IOException
public static void transfer(File f, URLConnection c, IOUtilities.TransferCallback cb) throws Exception
Exception
public static void transfer(URLConnection c, File f, IOUtilities.TransferCallback cb) throws Exception
Exception
public static void transfer(InputStream s, File f, IOUtilities.TransferCallback cb) throws Exception
Exception
public static void transfer(InputStream in, OutputStream out, IOUtilities.TransferCallback cb) throws IOException
IOException
public static void transfer(InputStream in, byte[] bytes) throws IOException
IOException
public static void transfer(InputStream in, OutputStream out) throws IOException
IOException
public static void transfer(File file, OutputStream out) throws IOException
IOException
public static void close(Closeable c)
public static void flush(Flushable f)
public static byte[] inputStreamToBytes(InputStream in)
public static void compressBytes(ByteArrayOutputStream original, ByteArrayOutputStream compressed) throws IOException
IOException
Copyright © 2014. All rights reserved.