Package org.refcodes.io
Interface ByteProvider
-
- All Superinterfaces:
ByteBlockProvider,ByteDatagramProvider
- All Known Subinterfaces:
BidirectionalConnectionByteTransceiver<INPUT,OUTPUT>,BidirectionalStreamConnectionByteTransceiver,ByteArrayProvider,ByteArrayReceiver,ByteReceiver,ByteTransceiver,ConnectionByteReceiver<CON>,ConnectionByteTransceiver<CON>,InputStreamConnectionByteReceiver,LoopbackByteReceiver,LoopbackByteTransceiver
- All Known Implementing Classes:
AbstractByteProvider,AbstractByteReceiver,AbstractInputStreamByteReceiver,AbstractPrefetchInputStreamByteReceiver,BidirectionalStreamByteTransceiverImpl,BidirectionalStreamConnectionByteTransceiverImpl,ByteArrayProviderImpl,ByteArrayReceiverImpl,ByteReceiverDecorator,InputStreamByteReceiverImpl,InputStreamConnectionByteReceiverImpl,LoopbackByteReceiverImpl,LoopbackByteTransceiverImpl,PrefetchBidirectionalStreamByteTransceiverImpl,PrefetchBidirectionalStreamConnectionByteTransceiverImpl,PrefetchInputStreamByteReceiverImpl,PrefetchInputStreamConnectionByteReceiverImpl
- 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 ByteProvider extends ByteDatagramProvider, ByteBlockProvider
The Interface ByteProvider.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default byte[]readDatagrams()Caution: Reads till anOpenException(or anInterruptedExceptionin 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
-
-
-
-
Method Detail
-
readDatagrams
default byte[] readDatagrams() throws org.refcodes.component.OpenException, java.lang.InterruptedExceptionCaution: Reads till anOpenException(or anInterruptedExceptionin case of blocking till more data is available) occurs. Reads (receives) the next byte block passed from aBlockSenderorDatagramSendercounterpart. In case none byte block is available, then this method blocks until one is available. When aThreadis waiting for a byte to be read andThread.interrupt()is being called, then the operation is aborted and anInterruptedExceptionis thrown.- Specified by:
readDatagramsin interfaceByteBlockProvider- Returns:
- The next byte block sent from the
BlockSenderorDatagramReceivercounterpart. - Throws:
org.refcodes.component.OpenException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.java.lang.InterruptedException- Thrown when aThreadis waiting, sleeping, or otherwise occupied, and theThreadis interrupted, either before or during the activity.
-
readDatagrams
default byte[] readDatagrams(int aBlockSize) throws org.refcodes.component.OpenException, java.lang.InterruptedExceptionSimilar toByteBlockProvider.readDatagrams()though at maximum the amount of data as provided by the block-size is returned.- Specified by:
readDatagramsin interfaceByteBlockProvider- 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
BlockSenderorDatagramReceivercounterpart. - Throws:
org.refcodes.component.OpenException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.java.lang.InterruptedException- Thrown when aThreadis waiting, sleeping, or otherwise occupied, and theThreadis interrupted, either before or during the activity.
-
-