Class 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 Detail

      • charset

        private final java.nio.charset.Charset charset
    • Constructor Detail

      • AsCharSink

        private AsCharSink​(java.nio.charset.Charset charset)
    • Method Detail

      • openStream

        public java.io.Writer openStream()
                                  throws java.io.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:
        java.io.IOException - if an I/O error occurs while opening the writer
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object