|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IOCopier
Interface for tools that copy data from an input source to an output sink.
Implementation should be designed for a single copy task; they are thrown
away and garbage collected after the copy is complete. Partial or
fixed-length copies are allowed via the copy(long) method. Full
copies are done by the copy(). Closing of the streams is optional,
and should be performed by the close() method.
Typical usage is:
copier = new StreamCopier(input, output); copier.copy(); copier.close();
Copyright 2006 Partner Software, Inc.
| Method Summary | |
|---|---|
void |
close()
Closes input source and output sink. |
long |
copy()
Copies all available data from the source to the sink. |
long |
copy(long howMuch)
Copies the specified amount of data from the source to the sink. |
long |
copyBlockingOnce()
Block only once, copying available data, but quit as soon as a block would occur. |
long |
copyWithoutBlocking()
Copies only available data. |
| Method Detail |
|---|
long copy()
throws java.io.IOException
java.io.IOException - if something prevents the copy
long copyWithoutBlocking()
throws java.io.IOException
This method is optional, if it's not appropriate for the kind of copy, throws an UnsupportedOperationException.
java.io.IOException
long copyBlockingOnce()
throws java.io.IOException
This method is optional, if it's not appropriate for the kind of copy, throws an UnsupportedOperationException.
java.io.IOException
long copy(long howMuch)
throws java.io.IOException
howMuch - how many items (bytes, characters, etc.) to copy
java.io.IOException - if something prevents the copy or if there are not enough
items to copy
void close()
throws java.io.IOException
java.io.IOException - if anything prevents closing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||