ByteDestination
BidirectionalConnectionByteTransceiver<INPUT,OUTPUT>
, BidirectionalStreamConnectionByteTransceiver
, BytesReceiver
, BytesTransceiver
, ConnectionBytesReceiver<CON>
, ConnectionBytesTransceiver<CON>
, InputStreamConnectionByteReceiver
AbstractBytesDestination
, AbstractBytesReceiver
, AbstractInputStreamByteReceiver
, AbstractPrefetchInputStreamByteReceiver
, BidirectionalStreamByteTransceiver
, BidirectionalStreamConnectionByteTransceiverImpl
, ByteArrayReceiver
, BytesReceiverDecorator
, InputStreamByteReceiver
, InputStreamConnectionByteReceiverImpl
, LoopbackBytesReceiver
, LoopbackBytesTransceiver
, PrefetchBidirectionalStreamByteTransceiver
, PrefetchBidirectionalStreamConnectionByteTransceiver
, PrefetchInputStreamByteReceiver
, PrefetchInputStreamConnectionByteReceiver
@FunctionalInterface public interface BytesDestination extends ByteDestination
BytesDestination
is used to receive byte blocks (arrays) in a
unified way. The receiveAllBytes()
method provides the next
available short block from the counterpart DatagramsTransmitter
or
DatagramTransmitter
; in case there is none available, then this
method halts until one is available.Modifier and Type | Method | Description |
---|---|---|
default byte[] |
receiveAllBytes() |
Reads (receives) the all currently available data.
|
byte |
receiveByte() |
Reads (receives) the next byte, in case none byte is available, then this
method blocks until one is available.
|
default void |
receiveBytes(byte[] aBuffer,
int aOffset,
int aLength) |
Receives a byte array with the number of bytes specified inserted at the
given offset.
|
default byte[] |
receiveBytes(int aMaxLength) |
Similar to
receiveAllBytes() though at maximum the amount of
data as of the provided length returned. |
byte receiveByte() throws IOException
receiveByte
in interface ByteDestination
IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default byte[] receiveAllBytes() throws IOException
DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default byte[] receiveBytes(int aMaxLength) throws IOException
receiveAllBytes()
though at maximum the amount of
data as of the provided length returned.aMaxLength
- The block-size which is not to exceeded by the returned
data. A value of -1 specifies to retrieve all available datagrams
(same behavior as method receiveAllBytes()
.DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default void receiveBytes(byte[] aBuffer, int aOffset, int aLength) throws IOException
aBuffer
- The byte array where to store the bytes at.aOffset
- The offset where to start storing the received bytes.aLength
- The number of bytes to receive.IOException
- thrown in case of I/O issues (e.g. a timeout) while
receiving.Copyright © 2021. All rights reserved.