public final class AsyncStreamHelper extends Object
AsyncInputStream or AsyncOutputStream instances.
Provides support for:
byte[] - Converts byte arrays into Async StreamsByteBuffer - Converts ByteBuffers into Async StreamsInputStream - Converts InputStreams into Async Streams (Note: InputStream implementations are blocking)OutputStream - Converts OutputStreams into Async Streams (Note: OutputStream implementations are blocking)| Modifier and Type | Method and Description |
|---|---|
static AsyncInputStream |
toAsyncInputStream(byte[] srcBytes)
Converts a
byte[] into a AsyncInputStream |
static AsyncInputStream |
toAsyncInputStream(ByteBuffer srcByteBuffer)
Converts a
ByteBuffer into a AsyncInputStream |
static AsyncInputStream |
toAsyncInputStream(InputStream inputStream)
Converts a
InputStream into a AsyncInputStream |
static AsyncOutputStream |
toAsyncOutputStream(byte[] dstBytes)
Converts a
byte[] into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(ByteBuffer dstByteBuffer)
Converts a
ByteBuffer into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(OutputStream outputStream)
Converts a
OutputStream into a AsyncOutputStream |
public static AsyncInputStream toAsyncInputStream(byte[] srcBytes)
byte[] into a AsyncInputStreamsrcBytes - the data sourcepublic static AsyncOutputStream toAsyncOutputStream(byte[] dstBytes)
byte[] into a AsyncOutputStreamdstBytes - the data destinationpublic static AsyncInputStream toAsyncInputStream(ByteBuffer srcByteBuffer)
ByteBuffer into a AsyncInputStreamsrcByteBuffer - the data sourcepublic static AsyncOutputStream toAsyncOutputStream(ByteBuffer dstByteBuffer)
ByteBuffer into a AsyncOutputStreamdstByteBuffer - the data destinationpublic static AsyncInputStream toAsyncInputStream(InputStream inputStream)
InputStream into a AsyncInputStreaminputStream - the InputStreampublic static AsyncOutputStream toAsyncOutputStream(OutputStream outputStream)
OutputStream into a AsyncOutputStreamoutputStream - the OutputStream