public interface ByteReceiver extends ByteDatagramReceiver, ByteBlockReceiver
ConnectableComponent.ConnectableAutomaton
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedProperty
Closable.CloseAutomaton
ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedProperty
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusProperty
Modifier and Type | Method and Description |
---|---|
default byte[] |
readDatagrams()
Reads (receives) the next byte block passed from a
BlockSender or DatagramSender counterpart. |
readDatagram
hasDatagram
isOpened
isClosable
isClosed
getConnectionStatus
default byte[] readDatagrams() throws OpenException, InterruptedException
ByteBlockReceiver
BlockSender
or DatagramSender
counterpart. In case none
byte block is available, then this method blocks until one is
available. To prevent blocking, use the Receivable.hasDatagram()
method to
test beforehand whether a byte is available (in a multi threaded
usage scenario, #hasBlock()
is not a reliable indicator whether
this method will block or not).
When a Thread
is waiting for a byte to be read and
Thread.interrupt()
is being called, then the operation is aborted
and an InterruptedException
is thrown.readDatagrams
in interface ByteBlockReceiver
BlockSender
or
DatagramReceiver
counterpart.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.InterruptedException
- Thrown when a Thread
is waiting,
sleeping, or otherwise occupied, and the Thread
is
interrupted, either before or during the activity.Copyright © 2016. All rights reserved.