01: package velosurf.util;
02:
03: import java.io.Reader;
04: import java.io.InputStream;
05: import java.io.IOException;
06:
07: /**
08: * Simple class to allow casting a reader in an input stream.
09: *
10: * @author <a href=mailto:claude.brisson@gmail.com>Claude Brisson</a>
11: */
12: public class ReaderInputStream extends InputStream {
13:
14: private Reader reader = null;
15:
16: public ReaderInputStream(Reader reader) {
17: this .reader = reader;
18: }
19:
20: public int read() throws IOException {
21: return reader.read();
22: }
23: }
|