Interface SegmentDestination

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
The SegmentDestination is used to receive Segment instances in a unified way.
  • Method Details

    • receiveSegment

      <SEGMENT extends Segment> void receiveSegment(SEGMENT aSegment) throws IOException
      Receives a Segment (and blocks this thread) till all it's Sequence data has been received and updates the Segment by invoking Segment.fromTransmission(Sequence). This method blocks till all bytes are read.
      Type Parameters:
      SEGMENT - The Segment type describing the Segment subclass of implementing Segment types.
      Parameters:
      aSegment - The Segment to be (re-)initialized with the received data.
      Throws:
      IOException - thrown in case of I/O issues (e.g. a timeout) while receiving.