Module java.base
Package java.io

Class Reader

    • Field Summary

      Fields
      Modifier and Type Field Description
      protected Object lock
      The object used to synchronize operations on this stream.
    • Constructor Summary

      Constructors
      Modifier Constructor Description
      protected Reader()
      Creates a new character-stream reader whose critical sections will synchronize on the reader itself.
      protected Reader​(Object lock)
      Creates a new character-stream reader whose critical sections will synchronize on the given object.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void close()
      Closes the stream and releases any system resources associated with it.
      void mark​(int readAheadLimit)
      Marks the present position in the stream.
      boolean markSupported()
      Tells whether this stream supports the mark() operation.
      static Reader nullReader()
      Returns a new Reader that reads no characters.
      int read()
      Reads a single character.
      int read​(char[] cbuf)
      Reads characters into an array.
      abstract int read​(char[] cbuf, int off, int len)
      Reads characters into a portion of an array.
      int read​(CharBuffer target)
      Attempts to read characters into the specified character buffer.
      boolean ready()
      Tells whether this stream is ready to be read.
      void reset()
      Resets the stream.
      long skip​(long n)
      Skips characters.
      long transferTo​(Writer out)
      Reads all characters from this reader and writes the characters to the given writer in the order that they are read.