Module org.refcodes.serial
Package org.refcodes.serial
Interface ArraySegment<SEGMENT extends Segment>
-
- Type Parameters:
SEGMENT
- The type of the arraySegment
elements.
- All Superinterfaces:
org.refcodes.mixin.AliasAccessor
,org.refcodes.mixin.ArrayAccessor<SEGMENT[]>
,org.refcodes.mixin.ArrayAccessor.ArrayBuilder<SEGMENT[],ArrayTransmission<SEGMENT>>
,org.refcodes.mixin.ArrayAccessor.ArrayMutator<SEGMENT[]>
,org.refcodes.mixin.ArrayAccessor.ArrayProperty<SEGMENT[]>
,ArrayTransmission<SEGMENT>
,org.refcodes.mixin.LengthAccessor
,Segment
,Segment.SegmentMixin
,Serializable
,Transmission
,Transmission.TransmissionMixin
public interface ArraySegment<SEGMENT extends Segment> extends Segment.SegmentMixin, Segment, ArrayTransmission<SEGMENT>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.ArrayAccessor
org.refcodes.mixin.ArrayAccessor.ArrayBuilder<T extends Object,B extends org.refcodes.mixin.ArrayAccessor.ArrayBuilder<T,B>>, org.refcodes.mixin.ArrayAccessor.ArrayMutator<T extends Object>, org.refcodes.mixin.ArrayAccessor.ArrayProperty<T 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.Segment
Segment.SegmentMixin
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default int
fromTransmission(Sequence aSequence, int aOffset)
(Re-)initializes this instance with the the givenSequence
data.default void
receiveFrom(InputStream aInputStream, OutputStream aReturnStream)
Default implementation harnessing theSegment.fromTransmission(Sequence)
method.-
Methods inherited from interface org.refcodes.serial.ArrayTransmission
getLength, toSchema, toSimpleTypeMap, toTransmission
-
Methods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
-
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Methods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
-
-
-
Method Detail
-
fromTransmission
default int fromTransmission(Sequence aSequence, int aOffset) throws TransmissionException
(Re-)initializes this instance with the the givenSequence
data.- Specified by:
fromTransmission
in interfaceSegment
- Parameters:
aSequence
- TheSequence
data from which to (re-)initialize this instance.aOffset
- The offset where to start processing the providedSequence
.- Returns:
- The index after the last offset into the given
Sequence
processed by this method. - Throws:
TransmissionException
- thrown in case a givenSequence
cannot be processed.
-
receiveFrom
default void receiveFrom(InputStream aInputStream, OutputStream aReturnStream) throws IOException, TransmissionException
Default implementation harnessing theSegment.fromTransmission(Sequence)
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 interfaceSegment
- Specified by:
receiveFrom
in interfaceSegment.SegmentMixin
- Parameters:
aInputStream
- TheInputStream
from which to read the instance's (re-)initializationSequence
from.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 given transmission cannot be processed.
-
-