Package nl.vpro.util

Class Copier.Builder

  • Enclosing class:
    Copier

    public static class Copier.Builder
    extends Object
    • Method Detail

      • input

        public Copier.Builder input​(@NonNull InputStream input)
        Parameters:
        input - The input stream to copy from (will be closed if ready)
        Returns:
        this.
      • expectedCount

        public Copier.Builder expectedCount​(@Nullable Long expectedCount)
        Returns:
        this.
      • output

        public Copier.Builder output​(@NonNull OutputStream output)
        Parameters:
        output - The output stream to copy to (will not be implicetely closed)
        Returns:
        this.
      • batch

        public Copier.Builder batch​(long batch)
        Parameters:
        batch - The size of batches (defaults to 8192)
        Returns:
        this.
      • batchConsumer

        public Copier.Builder batchConsumer​(@Nullable Consumer<Copier> batchConsumer)
        Parameters:
        batchConsumer - Some action to perform after each batch
        Returns:
        this.
      • callback

        public Copier.Builder callback​(@Nullable Consumer<Copier> callback)
        Parameters:
        callback - Called when ready, this should probably close the outputstream
        Returns:
        this.
      • name

        public Copier.Builder name​(@Nullable String name)
        Parameters:
        name - A name to assign to this copier
        Returns:
        this.
      • build

        public Copier build()