public final 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 |
close(XMLStreamReader reader) |
static void |
close(XMLStreamWriter writer) |
static byte[] |
compressBytes(byte[] bytes) |
static byte[] |
compressBytes(byte[] bytes,
int offset,
int len) |
static void |
compressBytes(ByteArrayOutputStream original,
ByteArrayOutputStream compressed) |
static void |
compressBytes(FastByteArrayOutputStream original,
FastByteArrayOutputStream compressed) |
static void |
flush(Flushable f) |
static void |
flush(XMLStreamWriter writer) |
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,
byte[] bytes)
Transfers a byte[] to the output stream of a URLConnection
|
static void |
transfer(URLConnection c,
File f,
IOUtilities.TransferCallback cb) |
static byte[] |
uncompressBytes(byte[] bytes) |
static byte[] |
uncompressBytes(byte[] bytes,
int offset,
int len) |
public static InputStream getInputStream(URLConnection c) throws IOException
IOExceptionpublic static void transfer(File f, URLConnection c, IOUtilities.TransferCallback cb) throws Exception
Exceptionpublic static void transfer(URLConnection c, File f, IOUtilities.TransferCallback cb) throws Exception
Exceptionpublic static void transfer(InputStream s, File f, IOUtilities.TransferCallback cb) throws Exception
Exceptionpublic static void transfer(InputStream in, OutputStream out, IOUtilities.TransferCallback cb) throws IOException
IOExceptionpublic static void transfer(InputStream in, byte[] bytes) throws IOException
IOExceptionpublic static void transfer(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static void transfer(File file, OutputStream out) throws IOException
IOExceptionpublic static void close(XMLStreamReader reader)
public static void close(XMLStreamWriter writer)
public static void close(Closeable c)
public static void flush(Flushable f)
public static void flush(XMLStreamWriter writer)
public static byte[] inputStreamToBytes(InputStream in)
public static void transfer(URLConnection c, byte[] bytes) throws IOException
c - Connection to transfer outputbytes - the bytes to sendIOExceptionpublic static void compressBytes(ByteArrayOutputStream original, ByteArrayOutputStream compressed) throws IOException
IOExceptionpublic static void compressBytes(FastByteArrayOutputStream original, FastByteArrayOutputStream compressed) throws IOException
IOExceptionpublic static byte[] compressBytes(byte[] bytes)
public static byte[] compressBytes(byte[] bytes,
int offset,
int len)
public static byte[] uncompressBytes(byte[] bytes)
public static byte[] uncompressBytes(byte[] bytes,
int offset,
int len)
Copyright © 2017. All rights reserved.