|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.io.ReaderCopier
public class ReaderCopier
Copies characters from a Reader to a Writer.
Typical usage:
input = new FileReader(FileLib.createFile("data/copyfrom.dat");
output = new FileWriter(FileLib.createFile("data/copyto.dat");
copier = new ReaderCopier(input, output);
copier.copy();
copier.close();
Copyright 2006 Partner Software, Inc.
| Constructor Summary | |
|---|---|
ReaderCopier(java.io.Reader source,
java.io.Writer sink)
Constructs a ReaderCopier for the given source and sink with standard buffer size. |
|
ReaderCopier(java.io.Reader source,
java.io.Writer sink,
int bufferSize)
Constructs a ReaderCopier for the given source, sink, and buffer size. |
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReaderCopier(java.io.Reader source,
java.io.Writer sink,
int bufferSize)
public ReaderCopier(java.io.Reader source,
java.io.Writer sink)
IOConstants.BUFFER_SIZE| Method Detail |
|---|
public long copy()
throws java.io.IOException
IOCopier
copy in interface IOCopierjava.io.IOException - if something prevents the copy
public long copy(long howMuch)
throws java.io.IOException
IOCopier
copy in interface IOCopierhowMuch - 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
public long copyWithoutBlocking()
throws java.io.IOException
IOCopierThis method is optional, if it's not appropriate for the kind of copy, throws an UnsupportedOperationException.
copyWithoutBlocking in interface IOCopierjava.io.IOException
public long copyBlockingOnce()
throws java.io.IOException
IOCopierThis method is optional, if it's not appropriate for the kind of copy, throws an UnsupportedOperationException.
copyBlockingOnce in interface IOCopierjava.io.IOException
public void close()
throws java.io.IOException
IOCopier
close in interface IOCopierjava.io.IOException - if anything prevents closing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||