rendered paste bodypublic class ReaderInputStream extends InputStream {
private Reader fReader;
public ReaderInputStream(Reader reader) {
fReader = reader;
}
@Override
public int read() throws IOException {
return fReader.read();
}
@Override
public void close() throws IOException {
fReader.close();
}
@Override
public synchronized void mark(int readlimit) {
try {
fReader.mark(readlimit);
} catch (IOException e) {
/* Ignore */
}
}
@Override
public boolean markSupported() {
return fReader.markSupported();
}
@Override
public synchronized void reset() throws IOException {
fReader.reset();
}
@Override
public long skip(long n) throws IOException {
return fReader.skip(n);
}
}