Class TextIO.Sink

    • Constructor Summary

      Constructors 
      Constructor Description
      Sink()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      Flushes the buffered state (if any) before the channel is closed.
      void open​(java.nio.channels.WritableByteChannel channel)
      Initializes writing to the given channel.
      TextIO.Sink withFooter​(java.lang.String footer)  
      TextIO.Sink withHeader​(java.lang.String header)  
      void write​(java.lang.String element)
      Appends a single element to the file.
      • Methods inherited from class java.lang.Object

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

      • Sink

        public Sink()
    • Method Detail

      • withHeader

        public TextIO.Sink withHeader​(java.lang.String header)
      • withFooter

        public TextIO.Sink withFooter​(java.lang.String footer)
      • open

        public void open​(java.nio.channels.WritableByteChannel channel)
                  throws java.io.IOException
        Description copied from interface: FileIO.Sink
        Initializes writing to the given channel. Will be invoked once on a given FileIO.Sink instance.
        Specified by:
        open in interface FileIO.Sink<java.lang.String>
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String element)
                   throws java.io.IOException
        Description copied from interface: FileIO.Sink
        Appends a single element to the file. May be invoked zero or more times.
        Specified by:
        write in interface FileIO.Sink<java.lang.String>
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Description copied from interface: FileIO.Sink
        Flushes the buffered state (if any) before the channel is closed. Does not need to close the channel. Will be invoked once.
        Specified by:
        flush in interface FileIO.Sink<java.lang.String>
        Throws:
        java.io.IOException