Package org.refcodes.io
Interface ByteReceiver
-
- All Superinterfaces:
ByteBlockProvider
,ByteBlockReceiver
,ByteDatagramProvider
,ByteDatagramReceiver
,ByteProvider
,org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseAutomaton
,org.refcodes.component.ClosedAccessor
,org.refcodes.component.ConnectableComponent
,org.refcodes.component.ConnectableComponent.ConnectableAutomaton
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.OpenedAccessor
,Receivable
,org.refcodes.mixin.Releaseable
- All Known Subinterfaces:
BidirectionalConnectionByteTransceiver<INPUT,OUTPUT>
,BidirectionalStreamConnectionByteTransceiver
,ByteArrayReceiver
,ByteTransceiver
,ConnectionByteReceiver<CON>
,ConnectionByteTransceiver<CON>
,InputStreamConnectionByteReceiver
,LoopbackByteReceiver
,LoopbackByteTransceiver
- All Known Implementing Classes:
AbstractByteReceiver
,AbstractInputStreamByteReceiver
,AbstractPrefetchInputStreamByteReceiver
,BidirectionalStreamByteTransceiverImpl
,BidirectionalStreamConnectionByteTransceiverImpl
,ByteArrayReceiverImpl
,ByteReceiverDecorator
,InputStreamByteReceiverImpl
,InputStreamConnectionByteReceiverImpl
,LoopbackByteReceiverImpl
,LoopbackByteTransceiverImpl
,PrefetchBidirectionalStreamByteTransceiverImpl
,PrefetchBidirectionalStreamConnectionByteTransceiverImpl
,PrefetchInputStreamByteReceiverImpl
,PrefetchInputStreamConnectionByteReceiverImpl
public interface ByteReceiver extends ByteProvider, ByteDatagramReceiver, ByteBlockReceiver
The Interface ByteReceiver.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
-
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default byte[]
readDatagrams()
Caution: Reads till anOpenException
(or anInterruptedException
in case of blocking till more data is available) occurs.default byte[]
readDatagrams(int aBlockSize)
Similar toByteBlockProvider.readDatagrams()
though at maximum the amount of data as provided by the block-size is returned.-
Methods inherited from interface org.refcodes.io.ByteDatagramProvider
readDatagram
-
Methods inherited from interface org.refcodes.component.Closable
close, closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isConnectionOpened
-
Methods inherited from interface org.refcodes.io.Receivable
hasDatagram
-
-
-
-
Method Detail
-
readDatagrams
default byte[] 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 byte block passed from aBlockSender
orDatagramSender
counterpart. In case none byte block is available, then this method blocks until one is available. When aThread
is waiting for a byte to be read andThread.interrupt()
is being called, then the operation is aborted and anInterruptedException
is thrown.- Specified by:
readDatagrams
in interfaceByteBlockProvider
- Specified by:
readDatagrams
in interfaceByteProvider
- Returns:
- The next byte 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 byte[] readDatagrams(int aBlockSize) throws org.refcodes.component.OpenException, java.lang.InterruptedException
Similar toByteBlockProvider.readDatagrams()
though at maximum the amount of data as provided by the block-size is returned.- Specified by:
readDatagrams
in interfaceByteBlockProvider
- Specified by:
readDatagrams
in interfaceByteProvider
- 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 methodByteBlockProvider.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.
-
-