Serializable
, org.refcodes.mixin.LengthAccessor
, Section
, Transmission
, Transmission.TransmissionMixin
public class AbstractSectionDecorator<SECTION extends Section> extends AbstractTransmissionDecorator<SECTION> implements Section
Section
.org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE,B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object>
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
Section.SectionMixin
Transmission.TransmissionMixin
_decoratee
Constructor | Description |
---|---|
AbstractSectionDecorator() |
|
AbstractSectionDecorator(SECTION aDecoratee) |
Instantiates a new abstract section decorator.
|
Modifier and Type | Method | Description |
---|---|---|
void |
fromTransmission(Sequence aSequence,
int aOffset,
int aLength) |
(Re-)initializes this instance with the the given
Sequence data. |
void |
receiveFrom(InputStream aInputStream,
int aLength,
OutputStream aReturnStream) |
(Re-)initializes this instance by receiving the according
Sequence from the given InputStream . |
Schema |
toSchema() |
Retrieves the
Schema representing the Transmission . |
void |
transmitTo(OutputStream aOutputStream,
InputStream aReturnStream) |
Transmits the
Sequence representing the implementing type's
instance to the given OutputStream . |
equals, getDecoratee, getLength, hashCode, toSimpleTypeMap, toString, toTransmission
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
fromInputStream, getLength, toSimpleTypeMap, toTransmission, transmitTo, transmitTo
public AbstractSectionDecorator()
public AbstractSectionDecorator(SECTION aDecoratee)
aDecoratee
- the a decorateepublic void transmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException
Sequence
representing the implementing type's
instance to the given OutputStream
. Implementations providing
error correction methods use the provided feedback InputStream
to
do some sort of "stop-and-wait ARQ" or apply similar methods to ensure
correctness of the transmitted data.transmitTo
in interface Transmission
transmitTo
in interface Transmission.TransmissionMixin
aOutputStream
- The OutputStream
where to write this
instance's Sequence
to.aReturnStream
- An InputStream
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.IOException
- thrown in case writing data to the
OutputStream
caused problems.public Schema toSchema()
Schema
representing the Transmission
.
Retrieving a Schema
is useful when analyzing and debugging data
structures such as a AllocSectionDecoratorSegment
instance to help
document, learn and verify on the structure (as well as the content) of
that very AllocSectionDecoratorSegment
.toSchema
in interface Transmission
Schema
representation of the implementing type for
debugging and verification (or documentation) purposes.public void fromTransmission(Sequence aSequence, int aOffset, int aLength) throws TransmissionException
Sequence
data.fromTransmission
in interface Section
aSequence
- The Sequence
data from which to (re-)initialize
this instance.aOffset
- The offset where to start processing the provided
Sequence
.aLength
- The length of data assigned by the Sequence
.TransmissionException
- thrown in case a given Sequence
cannot be processed.public void receiveFrom(InputStream aInputStream, int aLength, OutputStream aReturnStream) throws IOException, TransmissionException
Sequence
from the given InputStream
. Implementations
providing error correction methods use the provided feedback
OutputStream
to do some sort of "stop-and-wait ARQ" or apply
similar methods to ensure correctness of the received data.receiveFrom
in interface Section
aInputStream
- The InputStream
from which to read the
instance's (re-)initialization Sequence
from.aLength
- The length of data assigned by the byte array.aReturnStream
- An OutputStream
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.IOException
- thrown in case reading data from the
InputStream
caused problems.TransmissionException
- thrown in case a given InputStream
bytes cannot be processed.Copyright © 2021. All rights reserved.