com.mindoo.remote.api.tools.io
Class ReaderInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.mindoo.remote.api.tools.io.ReaderInputStream
All Implemented Interfaces:
java.io.Closeable

public class ReaderInputStream
extends java.io.InputStream

Class to convert a Reader into an InputStream

Internal utility class. Not part of the public API.


Field Summary
protected  java.lang.String m_encoding
           
protected  java.io.Reader m_reader
           
 
Constructor Summary
ReaderInputStream(java.io.Reader reader)
           
ReaderInputStream(java.io.Reader reader, java.lang.String encoding)
           
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_reader

protected java.io.Reader m_reader

m_encoding

protected java.lang.String m_encoding
Constructor Detail

ReaderInputStream

public ReaderInputStream(java.io.Reader reader)

ReaderInputStream

public ReaderInputStream(java.io.Reader reader,
                         java.lang.String encoding)
Method Detail

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException