Class MoreFiles.PathByteSink

  • Enclosing class:
    MoreFiles

    private static final class MoreFiles.PathByteSink
    extends ByteSink
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.OpenOption[] options  
      private java.nio.file.Path path  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PathByteSink​(java.nio.file.Path path, java.nio.file.OpenOption... options)  
    • Field Detail

      • path

        private final java.nio.file.Path path
      • options

        private final java.nio.file.OpenOption[] options
    • Constructor Detail

      • PathByteSink

        private PathByteSink​(java.nio.file.Path path,
                             java.nio.file.OpenOption... options)
    • Method Detail

      • openStream

        public java.io.OutputStream openStream()
                                        throws java.io.IOException
        Description copied from class: ByteSink
        Opens a new OutputStream for writing to this sink. This method returns a new, independent stream each time it is called.

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

        Specified by:
        openStream in class ByteSink
        Throws:
        java.io.IOException - if an I/O error occurs while opening the stream
      • toString

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