public final class Channels extends Object
OutputStream
, PrintStream
, InputStream
to the Java Channel
.
Channels
because the utility closes the stream as
soon as the particular Thread is interrupted. If the frameworks (Zookeeper, Netty) interrupts the thread, the
communication channels become closed and the JVM hangs. Therefore we developed internal utility which is safe for the
Surefire.Modifier and Type | Method and Description |
---|---|
static ReadableByteChannel |
newBufferedChannel(InputStream is) |
static WritableBufferedByteChannel |
newBufferedChannel(OutputStream out) |
static ReadableByteChannel |
newChannel(InputStream is) |
static WritableByteChannel |
newChannel(OutputStream out) |
static InputStream |
newInputStream(AsynchronousByteChannel channel) |
static OutputStream |
newOutputStream(AsynchronousByteChannel channel) |
public static WritableByteChannel newChannel(@Nonnull OutputStream out)
public static WritableBufferedByteChannel newBufferedChannel(@Nonnull OutputStream out)
public static ReadableByteChannel newChannel(@Nonnull InputStream is)
public static ReadableByteChannel newBufferedChannel(@Nonnull InputStream is)
public static OutputStream newOutputStream(AsynchronousByteChannel channel)
public static InputStream newInputStream(AsynchronousByteChannel channel)
Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.