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
,org.refcodes.mixin.Resetable
,org.refcodes.mixin.Schemable
,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:
-
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 inherited from class org.refcodes.serial.AbstractTransmissionDecorator
_decoratee
-
Constructor Summary
ConstructorDescriptionAbstractCipherTransmissionDecorator
(DECORATEE aDecoratee, Cipher aCipher) Constructs aCipher
transmission decorator applying bijective and inverse functions upon the delegated methods. -
Method Summary
Modifier and TypeMethodDescriptiontoSchema()
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, reset, 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 Details
-
_cipher
-
-
Constructor Details
-
AbstractCipherTransmissionDecorator
Constructs aCipher
transmission decorator applying bijective and inverse functions upon the delegated methods.
-
-
Method Details
-
transmitTo
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.
-
toSequence
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmission
instances) may be backed by the returnedSequence
.- Specified by:
toSequence
in interfaceTransmission
- Overrides:
toSequence
in classAbstractTransmissionDecorator<DECORATEE extends Transmission>
- Returns:
- The according instance's
Sequence
.
-
toSchema
-