Class YamlOutputStreamWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable, StreamDataWriter

    public abstract class YamlOutputStreamWriter
    extends java.io.OutputStreamWriter
    implements StreamDataWriter
    Provide an example of implementation of StreamDataWriter interface which does not throw IOException
    • Field Summary

      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      YamlOutputStreamWriter​(java.io.OutputStream out, java.nio.charset.Charset cs)
      Create
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      Flushes this stream by writing any buffered output to the underlying stream.
      abstract void processIOException​(java.io.IOException e)
      to be implemented
      void write​(java.lang.String str)
      write the whole data
      void write​(java.lang.String str, int off, int len)
      Write part of the data
      • Methods inherited from class java.io.OutputStreamWriter

        append, append, close, getEncoding, write, write
      • Methods inherited from class java.io.Writer

        append, nullWriter, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • YamlOutputStreamWriter

        public YamlOutputStreamWriter​(java.io.OutputStream out,
                                      java.nio.charset.Charset cs)
        Create
        Parameters:
        out - - the output
        cs - - encoding to use to translate String to bytes
    • Method Detail

      • processIOException

        public abstract void processIOException​(java.io.IOException e)
        to be implemented
        Parameters:
        e - - the reason
      • flush

        public void flush()
        Description copied from interface: StreamDataWriter
        Flushes this stream by writing any buffered output to the underlying stream.
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in interface StreamDataWriter
        Overrides:
        flush in class java.io.OutputStreamWriter
      • write

        public void write​(java.lang.String str,
                          int off,
                          int len)
        Description copied from interface: StreamDataWriter
        Write part of the data
        Specified by:
        write in interface StreamDataWriter
        Overrides:
        write in class java.io.OutputStreamWriter
        Parameters:
        str - - the data to write (the source)
        off - - offset to start from
        len - - number of chars to write
      • write

        public void write​(java.lang.String str)
        Description copied from interface: StreamDataWriter
        write the whole data
        Specified by:
        write in interface StreamDataWriter
        Overrides:
        write in class java.io.Writer
        Parameters:
        str - - data to write