hussam.io
Class StringInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by hussam.io.StringInputStream
All Implemented Interfaces:
java.io.Closeable

public class StringInputStream
extends java.io.InputStream

This is an input stream that takes the input from any StringInputReader. By rapping this into a BufferedReader(InputStreamReader()), you would have inputing capability from any source that implements StringInputReader.

Author:
حسام الملحم Hussam Al-Mulhim

Constructor Summary
StringInputStream(StringInputReader reader)
           
 
Method Summary
protected  byte[] getNewSentence()
          Returns an array of bytes representing a sentence.
 int read()
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringInputStream

public StringInputStream(StringInputReader reader)
Method Detail

read

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

getNewSentence

protected byte[] getNewSentence()
Returns an array of bytes representing a sentence. You can override this with caution to make sure of what to read. Try super calling this method first when overriding.