Serializable
, org.refcodes.mixin.LengthAccessor
, Segment
, Transmission
, Transmission.TransmissionMixin
public class CipherSegmentDecorator<DECORATEE extends Segment> extends AbstractCipherTransmissionDecorator<DECORATEE> implements Segment
CipherSegmentDecorator
is a transmission applying an
Invertible
on outgoing bytes (as of
Transmission.transmitTo(java.io.OutputStream)
or the like) and the inverse
function on any incoming bytes.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
Segment.SegmentMixin
Transmission.TransmissionMixin
_cipher
_decoratee
Constructor | Description |
---|---|
CipherSegmentDecorator(DECORATEE aDecoratee,
Cipher aCipher) |
Modifier and Type | Method | Description |
---|---|---|
int |
fromTransmission(Sequence aSequence,
int aOffset) |
(Re-)initializes this instance with the the given
Sequence data. |
void |
receiveFrom(InputStream aInputStream,
OutputStream aReturnStream) |
(Re-)initializes this instance by receiving the according
Sequence from the given InputStream . |
toSchema, toTransmission, transmitTo
equals, getDecoratee, getLength, hashCode, toSimpleTypeMap, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
fromInputStream, getLength, toSchema, toSimpleTypeMap, toTransmission, transmitTo, transmitTo, transmitTo
public int fromTransmission(Sequence aSequence, int aOffset) throws TransmissionException
Sequence
data.fromTransmission
in interface Segment
aSequence
- The Sequence
data from which to (re-)initialize
this instance.aOffset
- The offset where to start processing the provided
Sequence
.Sequence
processed by this method.TransmissionException
- thrown in case a given Sequence
cannot be processed.public void receiveFrom(InputStream aInputStream, 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 Segment
aInputStream
- The InputStream
from which to read the
instance's (re-)initialization Sequence
from.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 transmission cannot
be processed.Copyright © 2021. All rights reserved.