Class CharBuffer

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class CharBuffer extends Writer
A character buffer that acts as a Writer and uses cached char[] arrays.

Instances of this class are not thread-safe.

  • Constructor Details

    • CharBuffer

      public CharBuffer()
  • Method Details

    • write

      public void write(char[] cbuf, int off, int len)
      Specified by:
      write in class Writer
    • encode

      public ByteBuffer encode(Charset charset)
      Returns the content encoded into the given character set.
      charset - The character set.
      The encoded content.
    • flush

      public void flush()
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class Writer
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Writer