|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.asyncobjects.io.IOUtils
public class IOUtils
IO Utilties
| Field Summary | |
|---|---|
static int |
UNLIMITED
an unlmited value |
| Constructor Summary | |
|---|---|
IOUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
compare(AInput<D> in1,
AInput<D> in2,
int readSize)
Compare inputs. |
|
static
|
discard(AInput<D> in,
long length,
int readDataSize)
Discard specified amount of elements from input. |
|
static
|
forward(AInput<D> in,
AOutput<D> out,
long length,
int readDataSize)
Forward data from input to output |
|
static
|
forward(AInput<D> in,
AOutput<D> out,
long length,
int readDataSize,
boolean autoflush)
Forward data from input to output |
|
static Promise<BinaryData> |
readAll(AByteInput in,
int limit)
Read all data from the stream. |
|
static Promise<TextData> |
readAll(ATextInput in,
int limit)
Read all data from the stream. |
|
static
|
readAll(D initial,
AInput<D> in,
int limit)
Read all data from the stream. |
|
static Promise<BinaryData> |
readFully(AByteInput in,
int amount)
Read exactly specified amount data from byte input |
|
static Promise<TextData> |
readFully(ATextInput in,
int amount)
Read exactly specified amount data from text input |
|
static
|
readFully(D empty,
AInput<D> in,
int amount)
Read exactly specified amount data from byte input |
|
static
|
repeat(AOutput<D> out,
D data,
long length)
Write specified binary data repeating it until length bytes are written. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNLIMITED
| Constructor Detail |
|---|
public IOUtils()
| Method Detail |
|---|
public static <D extends BatchedData<D>> Promise<Long> discard(AInput<D> in,
long length,
int readDataSize)
D - a batched data typein - an inputlength - a length to discard, UNLIMITED means discard until
EOFreadDataSize - a portion that is used to discard
Long). Note that amount is counted using long's +
operation. So for very large datasets amount will be invalid.
public static <D extends BatchedData<D>> Promise<Long> repeat(AOutput<D> out,
D data,
long length)
D - a batched data typeout - an output streamdata - datalength - length to be written. if UNLIMITED, data is being
written infinitely until exception is encountered.
Long). Note that amount is counted using long's +
operation. So for very large datasets amount will be invalid.
public static Promise<BinaryData> readFully(AByteInput in,
int amount)
in - a byte input to read fromamount - an amount to read
public static Promise<TextData> readFully(ATextInput in,
int amount)
in - a byte input to read fromamount - an amount to read
public static <D extends BatchedData<D>> Promise<D> readFully(D empty,
AInput<D> in,
int amount)
D - a data typeempty - an empty datain - a byte input to read fromamount - an amount to read
public static final <D extends BatchedData<D>> Promise<Long> forward(AInput<D> in,
AOutput<D> out,
long length,
int readDataSize)
D - a batched data typein - a data sourceout - a data destinationlength - a length to copy (UNLIMITED means until eof)readDataSize - a portion to use during copying process
Long). Note that amount is counted using long's +
operation. So for very large datasets amount will be invalid.
public static final <D extends BatchedData<D>> Promise<Long> forward(AInput<D> in,
AOutput<D> out,
long length,
int readDataSize,
boolean autoflush)
D - a batched data typein - a data sourceout - a data destinationlength - a length to copy (UNLIMITED means until eof)readDataSize - a portion to use during copying processautoflush - if true, autoflush after each write
Long). Note that amount is counted using long's +
operation. So for very large datasets amount will be invalid.
public static <D extends BatchedData<D>> Promise<Integer> compare(AInput<D> in1,
AInput<D> in2,
int readSize)
D - a batched data typein1 - first inputin2 - second inputreadSize - max amount to read during single iteration of comparison
BinaryData for comparison
algorithm)
public static <D extends BatchedData<D>> Promise<D> readAll(D initial,
AInput<D> in,
int limit)
D - a datainitial - intial data, the next read data is appended to itin - input streamlimit - a limit for individual read operations
public static Promise<BinaryData> readAll(AByteInput in,
int limit)
in - input streamlimit - a limit for individual read operations
public static Promise<TextData> readAll(ATextInput in,
int limit)
in - input streamlimit - a limit for individual read operations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||