? TeeReader
java.lang.Object
java.io.Reader
java.io.FilterReader
org.apache.commons.io.input.ProxyReader
org.apache.commons.io.input.TeeReader
- ????????:
Closeable
,AutoCloseable
,Readable
Reader proxy that transparently writes a copy of all characters read from the proxied reader to a given Reader. Using
ProxyReader.skip(long)
or ProxyReader.mark(int)
/ProxyReader.reset()
on the reader will result on some characters from the
reader being skipped or duplicated in the writer.
The proxied reader is closed when the close()
method is called on this proxy. You may configure whether the
reader closes the writer.
- ???????:
- 2.7
-
????
??????? java.io.FilterReader
in
-
?????
???????? -
????
??????????void
close()
Closes the proxied reader and, if so configured, the associated writer.int
read()
Reads a single character from the proxied reader and writes it to the associated writer.int
read
(char[] chr) Reads characters from the proxied reader and writes the read characters to the associated writer.int
read
(char[] chr, int st, int end) Reads characters from the proxied reader and writes the read characters to the associated writer.int
read
(CharBuffer target) Reads characters from the proxied reader and writes the read characters to the associated writer.??????? org.apache.commons.io.input.ProxyReader
afterRead, beforeRead, handleIOException, mark, markSupported, ready, reset, skip
??????? java.io.Reader
nullReader, transferTo
-
???????
-
TeeReader
Creates a TeeReader that proxies the givenReader
and copies all read characters to the givenWriter
. The given writer will not be closed when this reader gets closed.- ??:
input
- reader to be proxiedbranch
- writer that will receive a copy of all characters read
-
TeeReader
Creates a TeeReader that proxies the givenReader
and copies all read characters to the givenWriter
. The given writer will be closed when this reader gets closed if the closeBranch parameter istrue
.- ??:
input
- reader to be proxiedbranch
- writer that will receive a copy of all characters readcloseBranch
- flag for closing also the writer when this reader is closed
-
-
??????
-
close
Closes the proxied reader and, if so configured, the associated writer. An exception thrown from the reader will not prevent closing of the writer.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ??:
close
???ProxyReader
- ??:
IOException
- if either the reader or writer could not be closed
-
read
Reads a single character from the proxied reader and writes it to the associated writer.- ??:
read
???ProxyReader
- ??:
- next character from the reader, or -1 if the reader has ended
- ??:
IOException
- if the reader could not be read (or written)
-
read
Reads characters from the proxied reader and writes the read characters to the associated writer.- ??:
read
???ProxyReader
- ??:
chr
- character buffer- ??:
- number of characters read, or -1 if the reader has ended
- ??:
IOException
- if the reader could not be read (or written)
-
read
Reads characters from the proxied reader and writes the read characters to the associated writer.- ??:
read
???ProxyReader
- ??:
chr
- character bufferst
- start offset within the bufferend
- maximum number of characters to read- ??:
- number of characters read, or -1 if the reader has ended
- ??:
IOException
- if the reader could not be read (or written)
-
read
Reads characters from the proxied reader and writes the read characters to the associated writer.- ???:
read
????Readable
- ??:
read
???ProxyReader
- ??:
target
- character buffer- ??:
- number of characters read, or -1 if the reader has ended
- ??:
IOException
- if the reader could not be read (or written)
-