Class StreamReader


  • public class StreamReader
    extends java.lang.Object
    Reader: checks if characters are in allowed range, adds '\0' to the end.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern NON_PRINTABLE  
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamReader​(java.io.Reader reader)  
      StreamReader​(java.lang.String stream)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forward()  
      void forward​(int length)
      read the next length characters and move the pointer.
      int getColumn()  
      java.nio.charset.Charset getEncoding()  
      int getIndex()  
      int getLine()  
      Mark getMark()  
      static boolean isPrintable​(char c)  
      char peek()  
      char peek​(int index)
      Peek the next index-th character
      java.lang.String prefix​(int length)
      peek the next length characters
      java.lang.String prefixForward​(int length)
      prefix(length) immediately followed by forward(length)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NON_PRINTABLE

        public static final java.util.regex.Pattern NON_PRINTABLE
    • Constructor Detail

      • StreamReader

        public StreamReader​(java.lang.String stream)
      • StreamReader

        public StreamReader​(java.io.Reader reader)
    • Method Detail

      • isPrintable

        public static boolean isPrintable​(char c)
      • getMark

        public Mark getMark()
      • forward

        public void forward()
      • forward

        public void forward​(int length)
        read the next length characters and move the pointer.
        Parameters:
        length -
      • peek

        public char peek()
      • peek

        public char peek​(int index)
        Peek the next index-th character
        Parameters:
        index -
        Returns:
        the next index-th character
      • prefix

        public java.lang.String prefix​(int length)
        peek the next length characters
        Parameters:
        length -
        Returns:
        the next length characters
      • prefixForward

        public java.lang.String prefixForward​(int length)
        prefix(length) immediately followed by forward(length)
      • getColumn

        public int getColumn()
      • getEncoding

        public java.nio.charset.Charset getEncoding()
      • getIndex

        public int getIndex()
      • getLine

        public int getLine()