Module org.refcodes.serial
Package org.refcodes.serial
Interface ArraySegment<SEGMENT extends Segment>
-
- Type Parameters:
SEGMENT- The type of the arraySegmentelements.
- 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 intfromTransmission(Sequence aSequence, int aOffset)(Re-)initializes this instance with the the givenSequencedata.default voidreceiveFrom(InputStream aInputStream, OutputStream aReturnStream)Default implementation harnessing theSegment.fromTransmission(Sequence)method.-
Methods inherited from interface org.refcodes.serial.ArrayTransmission
getLength, toSchema, toSequence, toSimpleTypeMap
-
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 givenSequencedata.- Specified by:
fromTransmissionin interfaceSegment- Parameters:
aSequence- TheSequencedata 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
Sequenceprocessed by this method. - Throws:
TransmissionException- thrown in case a givenSequencecannot 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 accordingSequencefrom the givenInputStream. Implementations providing error correction methods use the provided feedbackOutputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFromin interfaceSegment- Specified by:
receiveFromin interfaceSegment.SegmentMixin- Parameters:
aInputStream- TheInputStreamfrom which to read the instance's (re-)initializationSequencefrom.aReturnStream- AnOutputStreambeing 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 theInputStreamcaused problems.TransmissionException- thrown in case a given transmission cannot be processed.
-
-