Class ReaderAdapter

    • Method Detail

      • read

        public int read()
                 throws IOException
        Description copied from interface: Reader
        Reads a single character.

        Subclasses that intend to support efficient single-character input should override this method.

        Specified by:
        read in interface Reader
        Returns:
        The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
        Throws:
        IOException - If an I/O error occurs
      • read

        public int read​(char[] cbuf,
                        int off,
                        int len)
                 throws IOException
        Description copied from interface: Reader
        Reads characters into a portion of an array.
        Specified by:
        read in interface Reader
        Parameters:
        cbuf - Destination buffer
        off - Offset at which to start storing characters
        len - Maximum number of characters to read
        Returns:
        The number of characters read, or -1 if the end of the stream has been reached
        Throws:
        IOException - If an I/O error occurs
      • close

        public void close()
                   throws IOException
        Description copied from interface: Reader
        Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
        Specified by:
        close in interface Reader
        Throws:
        IOException - If an I/O error occurs