public class ProxyReader
extends Reader
This is similar to a FilterReader but allows changing the proxied
Reader with setProxied(java.util.Optional<java.io.Reader>) which must be called at least once
with a non null argument before calling any other method except
getProxied() and close() to avoid a null pointer exception.
| Constructor and Description |
|---|
ProxyReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Optional<Reader> |
getProxied()
Gets the proxied reader.
|
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(char[] buffer) |
int |
read(char[] buffer,
int offset,
int length) |
int |
read(CharBuffer target) |
boolean |
ready() |
void |
reset() |
void |
setProxied(Optional<Reader> proxied)
Sets the proxied reader.
|
long |
skip(long n) |
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException@Nonnull @CheckReturnValue public Optional<Reader> getProxied()
public void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Readerpublic int read()
throws IOException
read in class ReaderIOExceptionpublic int read(char[] buffer)
throws IOException
read in class ReaderIOExceptionpublic int read(CharBuffer target)
throws IOException
read in interface Readableread in class ReaderIOExceptionpublic int read(char[] buffer,
int offset,
int length)
throws IOException
read in class ReaderIOExceptionpublic boolean ready()
throws IOException
ready in class ReaderIOExceptionpublic void reset()
throws IOException
reset in class ReaderIOExceptionpublic void setProxied(@Nonnull
Optional<Reader> proxied)
proxied - The proxied reader (empty to cancel).public long skip(long n)
throws IOException
skip in class ReaderIOExceptionCopyright © 2003-2019 Serge Brisson. All Rights Reserved.