Class OutputTo

  • All Implemented Interfaces:
    Output

    public final class OutputTo
    extends Object
    implements Output
    An Output that encapsulates other destination for the data.

    There is no thread-safety guarantee.

    Since:
    0.12
    • Constructor Detail

      • OutputTo

        public OutputTo​(File file)
        Ctor.
        Parameters:
        file - The file
      • OutputTo

        public OutputTo​(File file,
                        boolean mkdirs)
        Ctor.
        Parameters:
        file - The file
        mkdirs - Should we do mkdirs beforehand?
        Since:
        0.15
      • OutputTo

        public OutputTo​(Path path)
        Ctor.
        Parameters:
        path - The path
      • OutputTo

        public OutputTo​(Path path,
                        boolean mkdirs)
        Ctor.
        Parameters:
        path - The path
        mkdirs - Should we do mkdirs beforehand?
        Since:
        0.15
      • OutputTo

        public OutputTo​(Writer writer)
        Ctor.
        Parameters:
        writer - The writer
      • OutputTo

        public OutputTo​(OutputStream stream)
        Ctor.
        Parameters:
        stream - The stream
    • Method Detail

      • stream

        public OutputStream stream()
                            throws Exception
        Description copied from interface: Output
        Get write access to it.
        Specified by:
        stream in interface Output
        Returns:
        OutputStream to write to
        Throws:
        Exception - If something goes wrong