java.lang.Object
xyz.apollosoftware.bibliothiki.compression.utils.Streams

public final class Streams extends Object
Utility methods for working with streams.
  • Method Details

    • pipeNBytes

      public static long pipeNBytes(@NonNull InputStream input, @NonNull OutputStream output, long n)
      Pipe n bytes from the given InputStream to the given OutputStream.

      If n is less than or equal to zero, this method immediately returns zero.

      Parameters:
      input - The input stream to read bytes from.
      output - The output stream to write bytes to.
      n - The number of bytes to pipe.
      Returns:
      The number of bytes that were piped.