Module org.hsqldb

Class AsciiInputStream

  • All Implemented Interfaces:, java.lang.AutoCloseable

    public class AsciiInputStream
    An input stream that reads US-ASCII values from a Reader, in compliance with the Java US_ASCII Charset encoder, including utf-16-surrogate-pairs.
    Campbell Burnet (campbell-burnet@users dot
    • Constructor Summary

      Constructor Description
      AsciiInputStream​( reader)
      Constructs a new instance for the given reader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int read()
      Reads the next byte of data from the input stream.
      • Methods inherited from class

        available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • AsciiInputStream

        public AsciiInputStream​( reader)
        Constructs a new instance for the given reader.
        reader - from which to read
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
        close in class
      • read

        public int read()
        Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to ASCII_MAX. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

        UTF-16 characters above ASCII_MAX produce a NON_ASCII_REPLACEMENT value when read.

        Surrogate pairs are correctly counted as a single character and produce a single NON_ASCII_REPLACEMENT value when read.

        Specified by:
        read in class
        the next byte of data, or -1 if the end of the stream is reached.
        Throws: - if an I/O error occurs.