public class InputStreamPumper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
InputStreamPumper.Writable |
Modifier and Type | Method and Description |
---|---|
static InputStream |
asInterruptible(InputStream is)
Relies on
InputStream.available() and a Thread sleep to ensure that the reads are interruptible. |
static CompletableFuture<?> |
pump(InputStream in,
InputStreamPumper.Writable out,
Executor executor)
Pumps the given
InputStream into the InputStreamPumper.Writable target via a task started in the given Executor . |
static void |
transferTo(InputStream in,
InputStreamPumper.Writable out)
See InputStream.transferTo(java.io.OutputStream) in Java 9 or later
|
public static InputStream asInterruptible(InputStream is)
InputStream.available()
and a Thread sleep to ensure that the reads are interruptible.public static void transferTo(InputStream in, InputStreamPumper.Writable out) throws IOException
IOException
public static CompletableFuture<?> pump(InputStream in, InputStreamPumper.Writable out, Executor executor)
InputStream
into the InputStreamPumper.Writable
target via a task started in the given Executor
.
InputStream
is not interruptible, such as System.in, use asInterruptible(InputStream)
to decorate the stream for this call.Copyright © 2015–2020 Red Hat. All rights reserved.