- 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.
The
SegmentDestination
is used to receive Segment
instances
in a unified way.-
Method Summary
Modifier and TypeMethodDescription<SEGMENT extends Segment>
voidreceiveSegment
(SEGMENT aSegment) Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
.
-
Method Details
-
receiveSegment
<SEGMENT extends Segment> void receiveSegment(SEGMENT aSegment) throws TransmissionException, IOException Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
. This method blocks till all bytes are read.- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass of implementingSegment
types.- Parameters:
aSegment
- TheSegment
to 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.
-