Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

alice.util
Class StringInputStream  view StringInputStream download StringInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byalice.util.StringInputStream
All Implemented Interfaces:
java.io.Closeable

public class StringInputStream
extends java.io.InputStream

managing a String or other InputStream as a character source


Field Summary
private  int line
          current line on stream
private  int pos
          current char pos on stream
private  java.lang.String source
          alternative input source
 
Constructor Summary
StringInputStream(java.lang.String s)
           
 
Method Summary
 int getCurrentLine()
           
 int getCurrentPos()
           
 int read()
          read a char
 void reset()
          This method resets a stream to the point where the mark() method was called.
 void seek(int n)
          go to n-th char
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private java.lang.String source
alternative input source


pos

private int pos
current char pos on stream


line

private int line
current line on stream

Constructor Detail

StringInputStream

public StringInputStream(java.lang.String s)
Method Detail

read

public int read()
         throws java.io.IOException
read a char


reset

public void reset()
           throws java.io.IOException
Description copied from class: java.io.InputStream
This method resets a stream to the point where the mark() method was called. Any bytes that were read after the mark point was set will be re-read during subsequent reads.

This method always throws an IOException in this class, but subclasses can override this method if they provide mark/reset functionality.


seek

public void seek(int n)
go to n-th char


getCurrentPos

public int getCurrentPos()

getCurrentLine

public int getCurrentLine()