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,org.refcodes.mixin.Resetable,org.refcodes.schema.Schemable,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.AliasPropertyNested 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.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Segment
Segment.SegmentMixinNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Method Summary
Modifier and TypeMethodDescriptiondefault 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.mixin.AliasAccessor
getAliasMethods inherited from interface org.refcodes.mixin.ArrayAccessor
getArrayMethods inherited from interface org.refcodes.mixin.ArrayAccessor.ArrayBuilder
withArrayMethods inherited from interface org.refcodes.mixin.ArrayAccessor.ArrayMutator
setArrayMethods inherited from interface org.refcodes.mixin.ArrayAccessor.ArrayProperty
letArrayMethods inherited from interface org.refcodes.serial.ArrayTransmission
getLength, toSchema, toSequence, toSimpleTypeMapMethods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface org.refcodes.serial.Transmission
reset, transmitTo, transmitToMethods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
Method Details
-
fromTransmission
(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 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.
-