Class AsciiStreamReader


  • public class AsciiStreamReader
    extends java.io.StreamTokenizer
    Class to read specific fields in a stream. Each field is separated from the next by a java whitespace character (see the java.lang.Character doc).
    • Field Summary

      • Fields inherited from class java.io.StreamTokenizer

        nval, sval, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype
    • Constructor Summary

      Constructors 
      Constructor Description
      AsciiStreamReader​(java.io.InputStream stream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float readFloat()
      Return the current token as a float.
      int readInt()
      Return the current token as an integer.
      float readNextFloat()
      Read the next float in this stream.
      int readNextInt()
      Read the next integer in this stream.
      java.lang.String readNextString()
      Read the next string in this stream.
      • Methods inherited from class java.io.StreamTokenizer

        commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AsciiStreamReader

        public AsciiStreamReader​(java.io.InputStream stream)
    • Method Detail

      • readNextInt

        public int readNextInt()
                        throws java.io.IOException,
                               java.io.EOFException
        Read the next integer in this stream.
        Throws:
        java.io.EOFException - is thrown when TT_EOF is encountered instead of TT_NUMBER
        java.io.IOException
      • readNextFloat

        public float readNextFloat()
                            throws java.io.IOException,
                                   java.io.EOFException
        Read the next float in this stream.
        Throws:
        java.io.EOFException - is thrown when TT_EOF is encountered instead of TT_NUMBER
        java.io.IOException
      • readNextString

        public java.lang.String readNextString()
                                        throws java.io.IOException,
                                               java.io.EOFException
        Read the next string in this stream.
        Throws:
        java.io.EOFException - is thrown when TT_EOF is encountered instead of TT_WORD
        java.io.IOException
      • readInt

        public int readInt()
        Return the current token as an integer.
      • readFloat

        public float readFloat()
        Return the current token as a float.