|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.util.IoUtils
public final class IoUtils
Utility functions for IO.
| Constructor Summary | |
|---|---|
IoUtils()
|
|
| Method Summary | |
|---|---|
static long |
copy(InputStream in,
OutputStream out,
long originalByteCount)
Copies the InputStream to the specified OutputStream
for the specified number of bytes or until EOF or exception. |
static int |
copy(InputStream is,
OutputStream os,
WriteListener listener)
Copy bytes from an InputStream to an
OutputStream. |
static long |
copy(InputStream is,
RandomAccessFile raf,
long offset,
long length)
Copy method for copying data from an InputStream to a
RandomAccessFile. |
static long |
copy(InputStream is,
RandomAccessFile raf,
long offset,
long length,
LongRangeListener lrl,
WriteListener wl)
Copy method for copying data from an InputStream to a
RandomAccessFile. |
static byte[] |
deflate(String str)
|
static byte[] |
inflate(byte[] bytes)
|
static String |
inflateString(byte[] bytes)
|
static byte[] |
toByteArray(InputStream is,
int length)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IoUtils()
| Method Detail |
|---|
public static byte[] toByteArray(InputStream is,
int length)
throws IOException
IOException
public static int copy(InputStream is,
OutputStream os,
WriteListener listener)
throws IOException
InputStream to an
OutputStream.
This method buffers the input internally, so there is no need to use a
BufferedInputStream.
is - The InputStream to read fromos - The OutputStream to write tolistener - The listener for write events.
NullPointerException - if the input or output is null
IOException - if an I/O error occurs
public static long copy(InputStream in,
OutputStream out,
long originalByteCount)
throws IOException
InputStream to the specified OutputStream
for the specified number of bytes or until EOF or exception.
in - The InputStream to copy from.out - The OutputStream to copy to.originalByteCount - The number of bytes to copy.
IOException - If there's an IO error copying the bytes.
public static long copy(InputStream is,
RandomAccessFile raf,
long offset,
long length)
throws IOException
InputStream to a
RandomAccessFile.
is - The input data.raf - The file to write to.offset - The offset within the file to start writing at.length - The number of bytes to copy.
IOException - If any IO error occurs.
public static long copy(InputStream is,
RandomAccessFile raf,
long offset,
long length,
LongRangeListener lrl,
WriteListener wl)
throws IOException
InputStream to a
RandomAccessFile.
is - The input data.raf - The file to write to.offset - The offset within the file to start writing at.length - The number of bytes to copy.
IOException - If any IO error occurs.public static byte[] deflate(String str)
public static String inflateString(byte[] bytes)
public static byte[] inflate(byte[] bytes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||