Class ByteSink.AsCharSink

java.lang.Object
com.google.common.io.CharSink
com.google.common.io.ByteSink.AsCharSink
Enclosing class:
ByteSink

private final class ByteSink.AsCharSink extends CharSink
A char sink that encodes written characters with a charset and writes resulting bytes to this byte sink.
  • Field Details

    • charset

      private final Charset charset
  • Constructor Details

    • AsCharSink

      private AsCharSink(Charset charset)
  • Method Details

    • openStream

      public Writer openStream() throws IOException
      Description copied from class: CharSink
      Opens a new Writer for writing to this sink. This method returns a new, independent writer each time it is called.

      The caller is responsible for ensuring that the returned writer is closed.

      Specified by:
      openStream in class CharSink
      Throws:
      IOException - if an I/O error occurs while opening the writer
    • toString

      public String toString()
      Overrides:
      toString in class Object