-
- All Superinterfaces:
org.refcodes.mixin.LengthAccessor
,Segment
,Serializable
,Transmission
,Transmission.TransmissionMixin
- All Known Subinterfaces:
ArraySegment<SEGMENT>
- All Known Implementing Classes:
AbstractPayloadSegment
,AsciizArraySegment
,AsciizSegment
,AssertMagicBytesSegment
,AssertMagicBytesSegmentDecorator
,BooleanSegment
,ByteSegment
,ComplexTypeSegment
,DoubleSegment
,FixedLengthSequenceSegment
,FloatSegment
,IntSegment
,LongSegment
,MagicBytesSegment
,MagicBytesSegmentDecorator
,NumberSegment
,SegmentComposite
,SequenceNumberSegment
,ShortSegment
- Enclosing interface:
- Segment
public static interface Segment.SegmentMixin extends Transmission.TransmissionMixin, Segment
Default implementation of theSegment
interface providing an implementation of thereceiveFrom(InputStream, OutputStream)
method using theSegment.fromTransmission(Sequence)
method or theSegment.fromTransmission(Sequence, int)
method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Segment
Segment.SegmentMixin
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
receiveFrom(InputStream aInputStream, OutputStream aReturnStream)
Default implementation harnessing theSegment.fromTransmission(Sequence)
method.-
Methods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
-
Methods inherited from interface org.refcodes.serial.Transmission
getLength, toSchema, toSequence, toSimpleTypeMap, transmitTo, transmitTo
-
Methods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
-
-
-
Method Detail
-
receiveFrom
default void receiveFrom(InputStream aInputStream, OutputStream aReturnStream) throws IOException, TransmissionException
Default implementation harnessing theSegment.fromTransmission(Sequence)
method. (Re-)initializes this instance by receiving the accordingSequence
from the givenInputStream
. Implementations providing error correction methods use the provided feedbackOutputStream
to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFrom
in interfaceSegment
- Parameters:
aInputStream
- TheInputStream
from which to read the instance's (re-)initializationSequence
from.aReturnStream
- AnOutputStream
being the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException
- thrown in case reading data from theInputStream
caused problems.TransmissionException
- thrown in case a given transmission cannot be processed.
-
-