public class ParcelableByteChannel extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ParcelableByteChannel.ParcelableByteBuffer
Parcelable buffer of bytes.
|
| Modifier and Type | Method and Description |
|---|---|
static ParcelableByteChannel |
byteChannel()
Returns a new byte channel.
|
static ParcelableByteChannel |
byteChannel(int dataBufferSize)
Returns a new byte channel.
Since the byte buffers generated by the channel are likely to be part of a remote procedure call, be aware of the limits imposed by the Android OS architecture when choosing a specific buffer size (see TransactionTooLargeException). |
static ParcelableByteChannel |
byteChannel(int dataBufferSize,
int corePoolSize)
Returns a new byte channel.
Since the byte buffers generated by the channel are likely to be part of a remote procedure call, be aware of the limits imposed by the Android OS architecture when choosing a specific buffer size (see TransactionTooLargeException). |
static ByteChannel.BufferInputStream |
inputStream(List<ParcelableByteChannel.ParcelableByteBuffer> buffers)
Creates an input stream returning the concatenation of the data contained in the specified
buffers.
Note that only one input stream can be created for each buffer. |
static ByteChannel.BufferInputStream |
inputStream(ParcelableByteChannel.ParcelableByteBuffer... buffers)
Creates an input stream returning the concatenation of the data contained in the specified
buffers.
Note that only one input stream can be created for each buffer. |
static ByteChannel.BufferInputStream |
inputStream(ParcelableByteChannel.ParcelableByteBuffer buffer)
Creates an input stream returning the data contained in the specified buffer.
Note that only one input stream can be created for each buffer. |
ByteChannel.BufferOutputStream |
passTo(InputChannel<? super ParcelableByteChannel.ParcelableByteBuffer> channel)
Returns the output stream used to write bytes into the specified channel.
Note that, if the method is called more than one time, passing the same input channel, it will return the same output stream. |
@Nonnull public static ParcelableByteChannel byteChannel()
@Nonnull public static ParcelableByteChannel byteChannel(int dataBufferSize)
TransactionTooLargeException).dataBufferSize - the size of the data buffer used to transfer the bytes through the
routine channels.IllegalArgumentException - if the specified size is 0 or negative.@Nonnull public static ParcelableByteChannel byteChannel(int dataBufferSize, int corePoolSize)
TransactionTooLargeException).dataBufferSize - the size of the data buffer used to transfer the bytes through the
routine channels.corePoolSize - the maximum number of data retained in the pool. Additional data
created to fulfill the bytes requirement will be discarded.IllegalArgumentException - if the specified size is 0 or negative.@Nonnull public static ByteChannel.BufferInputStream inputStream(@Nonnull ParcelableByteChannel.ParcelableByteBuffer buffer)
buffer - the byte buffer.IllegalStateException - if an input stream has been already created for the
specified buffer.@Nonnull public static ByteChannel.BufferInputStream inputStream(@Nonnull ParcelableByteChannel.ParcelableByteBuffer... buffers)
buffers - the byte buffers whose data have to be concatenated.IllegalStateException - if an input stream has been already created for one
of the specified buffers.@Nonnull public static ByteChannel.BufferInputStream inputStream(@Nonnull List<ParcelableByteChannel.ParcelableByteBuffer> buffers)
buffers - the byte buffers whose data have to be concatenated.IllegalStateException - if an input stream has been already created for one
of the specified buffers.@Nonnull public ByteChannel.BufferOutputStream passTo(@Nonnull InputChannel<? super ParcelableByteChannel.ParcelableByteBuffer> channel)
channel - the input channel to which to pass the data.