Class Streams

java.lang.Object
io.permazen.util.Streams

public final class Streams extends Object
Stream utility methods.
  • Method Details

    • exhaust

      public static void exhaust(Stream<?> stream)
      Read and discard everything from the given Stream.

      This method also ensures that the stream is always closed, even if an exception is thrown.

      Parameters:
      stream - stream to exhaust
      Throws:
      IllegalArgumentException - if stream is null