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 | Description |
---|---|---|
static AsyncInputStream |
toAsyncInputStream(byte[] srcBytes) |
Converts a
byte[] into a AsyncInputStream |
static AsyncInputStream |
toAsyncInputStream(InputStream inputStream) |
Converts a
InputStream into a AsyncInputStream |
static AsyncInputStream |
toAsyncInputStream(ByteBuffer srcByteBuffer) |
Converts a
ByteBuffer into a AsyncInputStream |
static AsyncOutputStream |
toAsyncOutputStream(byte[] dstBytes) |
Converts a
byte[] into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(OutputStream outputStream) |
Converts a
OutputStream into a AsyncOutputStream |
static AsyncOutputStream |
toAsyncOutputStream(ByteBuffer dstByteBuffer) |
Converts a
ByteBuffer 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(ByteBuffer srcByteBuffer)
ByteBuffer
into a AsyncInputStream
srcByteBuffer
- the data sourcepublic static AsyncOutputStream toAsyncOutputStream(ByteBuffer dstByteBuffer)
ByteBuffer
into a AsyncOutputStream
dstByteBuffer
- the data destinationpublic static AsyncInputStream toAsyncInputStream(InputStream inputStream)
InputStream
into a AsyncInputStream
inputStream
- the InputStreampublic static AsyncOutputStream toAsyncOutputStream(OutputStream outputStream)
OutputStream
into a AsyncOutputStream
outputStream
- the OutputStream