ShortDestination
ConnectionShortsReceiver<CON>
, ConnectionShortsTransceiver<CON>
, ShortsReceiver
, ShortsTransceiver
AbstractShortsDestination
, AbstractShortsReceiver
, LoopbackShortsReceiver
, LoopbackShortsTransceiver
, ShortArrayReceiver
, ShortsReceiverDecorator
@FunctionalInterface public interface ShortsDestination extends ShortDestination
ShortsDestination
is used to receive short blocks (arrays) in a
unified way. The receiveAllShorts()
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 short[] |
receiveAllShorts() |
Reads (receives) the all currently available data.
|
short |
receiveShort() |
Reads (receives) the next short available, in case none short is
available, then this method blocks until one is available.
|
default short[] |
receiveShorts(int aMaxLength) |
Similar to
receiveAllShorts() though at maximum the amount of
data as provided returned. |
default void |
receiveShorts(short[] aBuffer,
int aOffset,
int aLength) |
Receives a short array with the number of bytes specified inserted at the
given offset.
|
short receiveShort() throws IOException
receiveShort
in interface ShortDestination
ShortsTransmitter
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default short[] receiveAllShorts() throws IOException
DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default short[] receiveShorts(int aMaxLength) throws IOException
receiveAllShorts()
though at maximum the amount of
data as provided 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 receiveAllShorts()
.DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default void receiveShorts(short[] aBuffer, int aOffset, int aLength) throws IOException
aBuffer
- The short array where to store the shorts at.aOffset
- The offset where to start storing the received shorts.aLength
- The number of shorts to receive.IOException
- thrown in case of I/O issues (e.g. a timeout) while
receiving.Copyright © 2021. All rights reserved.