Package org.refcodes.io
Interface ShortProvider
-
- All Superinterfaces:
ShortBlockProvider
,ShortDatagramProvider
- All Known Subinterfaces:
ConnectionShortReceiver<CON>
,ConnectionShortTransceiver<CON>
,LoopbackShortReceiver
,LoopbackShortTransceiver
,ShortReceiver
,ShortTransceiver
- All Known Implementing Classes:
AbstractShortReceiver
,LoopbackShortReceiverImpl
,LoopbackShortTransceiverImpl
,ShortArrayReceiverImpl
,ShortReceiverDecorator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ShortProvider extends ShortDatagramProvider, ShortBlockProvider
The Interface ShortProvider.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default short[]
readDatagrams()
Caution: Reads till anOpenException
(or anInterruptedException
in case of blocking till more data is available) occurs.default short[]
readDatagrams(int aBlockSize)
Similar toShortBlockProvider.readDatagrams()
though at maximum the amount of data as provided by the block-size is returned.-
Methods inherited from interface org.refcodes.io.ShortDatagramProvider
readDatagram
-
-
-
-
Method Detail
-
readDatagrams
default short[] readDatagrams() throws org.refcodes.component.OpenException, java.lang.InterruptedException
Caution: Reads till anOpenException
(or anInterruptedException
in case of blocking till more data is available) occurs. Reads (receives) the next short block passed from aBlockSender
orDatagramSender
counterpart. In case none short block is available, then this method blocks until one is available. When aThread
is waiting for a short to be read andThread.interrupt()
is being called, then the operation is aborted and anInterruptedException
is thrown.- Specified by:
readDatagrams
in interfaceShortBlockProvider
- Returns:
- The next short block sent from the
BlockSender
orDatagramReceiver
counterpart. - Throws:
org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.java.lang.InterruptedException
- Thrown when aThread
is waiting, sleeping, or otherwise occupied, and theThread
is interrupted, either before or during the activity.
-
readDatagrams
default short[] readDatagrams(int aBlockSize) throws org.refcodes.component.OpenException, java.lang.InterruptedException
Similar toShortBlockProvider.readDatagrams()
though at maximum the amount of data as provided by the block-size is returned.- Specified by:
readDatagrams
in interfaceShortBlockProvider
- Parameters:
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 methodShortBlockProvider.readDatagrams()
.- Returns:
- The next short block sent from the
BlockSender
orDatagramReceiver
counterpart. - Throws:
org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.java.lang.InterruptedException
- Thrown when aThread
is waiting, sleeping, or otherwise occupied, and theThread
is interrupted, either before or during the activity.
-
-