- All Superinterfaces:
org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.Schemable<SerialSchema>
,Section
,Serializable
,Transmission
,Transmission.TransmissionMixin
- All Known Subinterfaces:
ArraySection<ARRAY>
- All Known Implementing Classes:
AbstractPayloadSection
,AssertMagicBytesSectionDecorator
,BooleanArraySection
,ByteArraySection
,CharArraySection
,CharSection
,DoubleArraySection
,DynamicTypeSection
,FileSection
,FixedSegmentArraySection
,FloatArraySection
,IntArraySection
,LongArraySection
,MagicBytesSectionDecorator
,PropertiesSection
,SectionComposite
,SegmentArraySection
,SequenceSection
,ShortArraySection
,StringArraySection
,StringSection
- Enclosing interface:
- Section
Default implementation of the
Section
interface providing an
implementation of the
receiveFrom(InputStream, int, OutputStream)
method using the
Section.fromTransmission(Sequence, int)
method or the
Section.fromTransmission(Sequence, int, 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.Section
Section.SectionMixin
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
receiveFrom
(InputStream aInputStream, int aLength, OutputStream aReturnStream) Default implementation harnessing theSection.fromTransmission(Sequence, int)
method.Methods inherited from interface org.refcodes.serial.Section
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 Details
-
receiveFrom
default void receiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream) throws IOException, TransmissionException Default implementation harnessing theSection.fromTransmission(Sequence, int)
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 interfaceSection
- Parameters:
aInputStream
- TheInputStream
from which to read the instance's (re-)initializationSequence
from.aLength
- The length of data assigned by the byte array.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 givenInputStream
bytes cannot be processed.
-