|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.StreamUtils
| Field Summary | |
static int |
CLOSE_INPUT
An option for transfer(). |
static int |
CLOSE_OUTPUT
An option for transfer(). |
static int |
DONT_CLOSE_IF_ABORTED
An option for transfer(). |
static int |
DONT_STOP_AFTER_KNOWN_SIZE
An option for transfer(). |
| Method Summary | |
static ByteArray |
readAllBytes(Handle h,
InputStream in,
ByteArray dest)
Read all the bytes from an InputStream, placing them in a ByteArray. |
static ByteArray |
readAllBytes(Handle h,
InputStream in,
ByteArray dest,
int knownSize,
int optionsAndBufferSize)
Read all the bytes from an InputStream, placing them in a ByteArray. |
static IOHandle |
readAllBytes(InputStream in,
ByteArray dest)
Read all the bytes in a separate thread. |
static IOHandle |
readAllBytes(InputStream in,
ByteArray dest,
int knownSize,
int optionsAndBufferSize)
Read all the bytes in a separate thread. |
static void |
readFully(InputStream in,
byte[] dest)
Reads in all the bytes of an array. |
static void |
readFully(InputStream in,
byte[] dest,
int start,
int count)
Reads in exactly a certain number of bytes. |
static int |
transfer(Handle h,
InputStream in,
OutputStream out)
Transfer data from an InputStream to an OutputStream. |
static int |
transfer(Handle h,
InputStream in,
OutputStream out,
int knownSize,
int optionsAndBufferSize)
Transfer data from an InputStream to an OutputStream. |
static int |
transfer(Handle h,
Reader in,
Writer out,
int knownSize,
int optionsAndBufferSize)
Transfer data from a Reader to a Writer. |
static IOHandle |
transfer(InputStream in,
OutputStream out)
Transfer data from an InputStream to an OutputStream in a separate thread. |
static IOHandle |
transfer(InputStream in,
OutputStream out,
int knownSize,
int optionsAndBufferSize)
Transfer data from an InputStream to an OutputStream in a separate thread. |
static IOHandle |
transfer(Reader in,
Writer out)
Transfer data from a Reader to a Writer in a separate thread. |
static IOHandle |
transfer(Reader in,
Writer out,
int knownSize,
int optionsAndBufferSize)
Transfer data from a Reader to a Writer in a separate thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public static final int CLOSE_INPUT
public static final int CLOSE_OUTPUT
public static final int DONT_STOP_AFTER_KNOWN_SIZE
public static final int DONT_CLOSE_IF_ABORTED
| Method Detail |
public static void readFully(InputStream in,
byte[] dest,
int start,
int count)
throws IOException,
EOFException
in - The InputStreamdest - The destination for the input data bytes.start - The offset in the dest to read from.count - The number of bytes to read.
IOException - If an I/O error occurs.
EOFException - If the stream ends before all the bytes are read.
public static void readFully(InputStream in,
byte[] dest)
throws IOException,
EOFException
in - The InputStreamdest - The destination for the input data bytes.
IOException
EOFException
public static int transfer(Handle h,
InputStream in,
OutputStream out,
int knownSize,
int optionsAndBufferSize)
throws IOException
h - an optional handle that can be used by another Thread to monitor and cancel the transfer.in - the InputStream.out - the OutputStream.knownSize - If the number of bytes is known, set this to be that value. Otherwise set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
IOException - if an IOException occurs.
public static int transfer(Handle h,
InputStream in,
OutputStream out)
throws IOException
h - an optional handle that can be used by another Thread to monitor and cancel the transfer.in - the InputStream.out - the OutputStream.
IOException - if an IOException occurs.
public static IOHandle transfer(InputStream in,
OutputStream out,
int knownSize,
int optionsAndBufferSize)
in - the InputStream.out - the OutputStream.knownSize - If the number of bytes is known, set this to be that value. Otherwise set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
public static IOHandle transfer(InputStream in,
OutputStream out)
in - the InputStream.out - the OutputStream.
public static ByteArray readAllBytes(Handle h,
InputStream in,
ByteArray dest,
int knownSize,
int optionsAndBufferSize)
throws IOException
h - an optional handle that can be used by another Thread to monitor and cancel the transfer.in - The input stream.dest - An optional destination ByteArray.knownSize - If the size is known then set this to be that size. If it is not known then set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
IOException - if an IOException occurs.
public static ByteArray readAllBytes(Handle h,
InputStream in,
ByteArray dest)
throws IOException
h - an optional handle that can be used by another Thread to monitor and cancel the transfer.in - The input stream.dest - An optional destination ByteArray.
IOException - if an IOException occurs.
public static IOHandle readAllBytes(InputStream in,
ByteArray dest,
int knownSize,
int optionsAndBufferSize)
in - The input stream.dest - An optional destination ByteArray.knownSize - If the size is known then set this to be that size. If it is not known then set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
public static IOHandle readAllBytes(InputStream in,
ByteArray dest)
in - The input stream.dest - An optional destination ByteArray.
public static int transfer(Handle h,
Reader in,
Writer out,
int knownSize,
int optionsAndBufferSize)
throws IOException
h - an optional handle that can be used by another Thread to monitor and cancel the transfer.in - the Reader.out - the Writer.knownSize - If the number of bytes is known, set this to be that value. Otherwise set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
IOException - if an IOException occurs.
public static IOHandle transfer(Reader in,
Writer out,
int knownSize,
int optionsAndBufferSize)
in - the Reader.out - the Writer.knownSize - If the number of bytes is known, set this to be that value. Otherwise set it to -1.optionsAndBufferSize - any of CLOSE_INPUT|CLOSE_OUTPUT|DONT_STOP_AFTER_KNOWN_SIZE OR'ed with
an optional buffer size specified in Kilobytes. e.g. CLOSE_INPUT|CLOSE_OUTPUT|10
public static IOHandle transfer(Reader in,
Writer out)
in - the Reader.out - the Writer.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||