Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractCipherTransmissionDecorator<DECORATEE extends Transmission>
- java.lang.Object
-
- org.refcodes.serial.AbstractTransmissionDecorator<DECORATEE>
-
- org.refcodes.serial.AbstractCipherTransmissionDecorator<DECORATEE>
-
- Type Parameters:
DECORATEE
- TheTransmission
type describing theTransmission
subclass to be enriched.s
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.DecorateeAccessor<DECORATEE>
,org.refcodes.mixin.LengthAccessor
,Transmission
,Transmission.TransmissionMixin
- Direct Known Subclasses:
CipherSectionDecorator
,CipherSegmentDecorator
public abstract class AbstractCipherTransmissionDecorator<DECORATEE extends Transmission> extends AbstractTransmissionDecorator<DECORATEE>
An abstract implementation of bijective and inverse functions applied to the decoratee's transmitting and receiving methods.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
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>
-
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.Transmission
Transmission.TransmissionMixin
-
-
Field Summary
Fields Modifier and Type Field Description protected Cipher
_cipher
-
Fields inherited from class org.refcodes.serial.AbstractTransmissionDecorator
_decoratee
-
-
Constructor Summary
Constructors Constructor Description AbstractCipherTransmissionDecorator(DECORATEE aDecoratee, Cipher aCipher)
Constructs aCipher
transmission decorator applying bijective and inverse functions upon the delegated methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Schema
toSchema()
Retrieves theSchema
representing theTransmission
.Sequence
toTransmission()
Provides theSequence
representation of thisTransmission
.void
transmitTo(OutputStream aOutputStream, InputStream aReturnStream)
Transmits theSequence
representing the implementing type's instance to the givenOutputStream
.-
Methods inherited from class org.refcodes.serial.AbstractTransmissionDecorator
equals, getDecoratee, getLength, hashCode, toSimpleTypeMap, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
-
-
-
Field Detail
-
_cipher
protected Cipher _cipher
-
-
Method Detail
-
transmitTo
public void transmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException
Transmits theSequence
representing the implementing type's instance to the givenOutputStream
. Implementations providing error correction methods use the provided feedbackInputStream
to do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Parameters:
aOutputStream
- TheOutputStream
where to write this instance'sSequence
to.aReturnStream
- AnInputStream
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 writing data to theOutputStream
caused problems.
-
toTransmission
public Sequence toTransmission()
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well.- Specified by:
toTransmission
in interfaceTransmission
- Overrides:
toTransmission
in classAbstractTransmissionDecorator<DECORATEE extends Transmission>
- Returns:
- The according instance's
Sequence
.
-
toSchema
public Schema toSchema()
Retrieves theSchema
representing theTransmission
. Retrieving aSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Returns:
- The
Schema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
-