public interface ShortReceiver extends ShortProvider, ShortDatagramReceiver, ShortBlockReceiver
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
Modifier and Type | Method and Description |
---|---|
default short[] |
readDatagrams()
Caution: Reads till an
OpenException (or an
InterruptedException in case of blocking till more data is
available) occurs. |
default short[] |
readDatagrams(int aBlockSize)
Similar to
ShortBlockProvider.readDatagrams() though at maximum the amount of data
as provided by the block-size is returned. |
readDatagram
hasDatagram
close, closeIn, closeQuietly, closeUnchecked
default short[] readDatagrams() throws org.refcodes.component.OpenException, InterruptedException
OpenException
(or an
InterruptedException
in case of blocking till more data is
available) occurs.
Reads (receives) the next short block passed from a BlockSender
or DatagramSender
counterpart. In case none short block is
available, then this method blocks until one is available.
When a Thread
is waiting for a short to be read and
Thread.interrupt()
is being called, then the operation is aborted
and an InterruptedException
is thrown.readDatagrams
in interface ShortBlockProvider
readDatagrams
in interface ShortProvider
BlockSender
or
DatagramReceiver
counterpart.org.refcodes.component.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.default short[] readDatagrams(int aBlockSize) throws org.refcodes.component.OpenException, InterruptedException
ShortBlockProvider.readDatagrams()
though at maximum the amount of data
as provided by the block-size is returned.readDatagrams
in interface ShortBlockProvider
readDatagrams
in interface ShortProvider
aBlockSize
- 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 ShortBlockProvider.readDatagrams()
.BlockSender
or
DatagramReceiver
counterpart.org.refcodes.component.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 © 2018. All rights reserved.