-
- All Known Subinterfaces:
Port<PM>,SegmentReceiver,SegmentTransceiver,SerialReceiver,SerialTransceiver
- All Known Implementing Classes:
AbstractPort,AbstractPortDecorator,CrossoverLoopbackPort,LoopbackPort
- 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 SegmentDestination
TheSegmentDestinationis used to receiveSegmentinstances in a unified way.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <SEGMENT extends Segment>
voidreceiveSegment(SEGMENT aSegment)Receives aSegment(and blocks this thread) till all it'sSequencedata has been received and updates theSegmentby invokingSegment.fromTransmission(Sequence).
-
-
-
Method Detail
-
receiveSegment
<SEGMENT extends Segment> void receiveSegment(SEGMENT aSegment) throws TransmissionException, IOException
Receives aSegment(and blocks this thread) till all it'sSequencedata has been received and updates theSegmentby invokingSegment.fromTransmission(Sequence). This method blocks till all bytes are read.- Type Parameters:
SEGMENT- TheSegmenttype describing theSegmentsubclass of implementingSegmenttypes.- Parameters:
aSegment- TheSegmentto be (re-)initialized with the received data.- Throws:
TransmissionException- Thrown in case the received data cannot be used to (re-)initialize the givenSegment.IOException- thrown in case of I/O issues (e.g. a timeout) while receiving.
-
-