public final class AsyncStreamHelper
extends java.lang.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(java.nio.ByteBuffer srcByteBuffer)
Converts a
ByteBuffer into a AsyncInputStream |
static AsyncInputStream |
toAsyncInputStream(java.io.InputStream inputStream)
Converts a
InputStream into a AsyncInputStream |
static AsyncOutputStream |
toAsyncOutputStream(byte[] dstBytes)
Converts a
byte[] into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(java.nio.ByteBuffer dstByteBuffer)
Converts a
ByteBuffer into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(java.io.OutputStream outputStream)
Converts a
OutputStream into a AsyncOutputStream |
public static AsyncInputStream toAsyncInputStream(byte[] srcBytes)
byte[]
into a AsyncInputStream
srcBytes
- the data sourcepublic static AsyncOutputStream toAsyncOutputStream(byte[] dstBytes)
byte[]
into a AsyncOutputStream
dstBytes
- the data destinationpublic static AsyncInputStream toAsyncInputStream(java.nio.ByteBuffer srcByteBuffer)
ByteBuffer
into a AsyncInputStream
srcByteBuffer
- the data sourcepublic static AsyncOutputStream toAsyncOutputStream(java.nio.ByteBuffer dstByteBuffer)
ByteBuffer
into a AsyncOutputStream
dstByteBuffer
- the data destinationpublic static AsyncInputStream toAsyncInputStream(java.io.InputStream inputStream)
InputStream
into a AsyncInputStream
inputStream
- the InputStreampublic static AsyncOutputStream toAsyncOutputStream(java.io.OutputStream outputStream)
OutputStream
into a AsyncOutputStream
outputStream
- the OutputStream