KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > lob > ReaderInputStream


1 //$Id: ReaderInputStream.java,v 1.1 2005/02/12 03:09:21 oneovthafew Exp $
2
package org.hibernate.lob;
3
4 import java.io.IOException JavaDoc;
5 import java.io.InputStream JavaDoc;
6 import java.io.Reader JavaDoc;
7
8 /**
9  * Exposes a <tt>Reader</tt> as an <tt>InputStream</tt>
10  * @author Gavin King
11  */

12 public class ReaderInputStream extends InputStream JavaDoc {
13     
14     private Reader JavaDoc reader;
15     
16     public ReaderInputStream(Reader JavaDoc reader) {
17         this.reader = reader;
18     }
19     
20     public int read() throws IOException JavaDoc {
21         return reader.read();
22     }
23     
24 }
25
Popular Tags