java.lang.Object
java.io.InputStream
org.refcodes.serial.SequenceInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.refcodes.mixin.OffsetAccessor
,SequenceAccessor
public class SequenceInputStream
extends InputStream
implements org.refcodes.mixin.OffsetAccessor, SequenceAccessor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.OffsetAccessor
org.refcodes.mixin.OffsetAccessor.OffsetBuilder<B extends org.refcodes.mixin.OffsetAccessor.OffsetBuilder<B>>, org.refcodes.mixin.OffsetAccessor.OffsetMutator, org.refcodes.mixin.OffsetAccessor.OffsetProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.SequenceAccessor
SequenceAccessor.SequenceBuilder<B extends SequenceAccessor.SequenceBuilder<B>>, SequenceAccessor.SequenceMutator, SequenceAccessor.SequenceProperty
-
Constructor Summary
ConstructorDescriptionSequenceInputStream
(Sequence aSequence) Uses the providedSequence
to provideInputStream
functionality.SequenceInputStream
(Sequence aSequence, int aOffset) Uses the providedSequence
to provideInputStream
functionality. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
SequenceInputStream
Uses the providedSequence
to provideInputStream
functionality.- Parameters:
aSequence
- TheSequence
to use.
-
SequenceInputStream
Uses the providedSequence
to provideInputStream
functionality.
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
getOffset
public int getOffset()- Specified by:
getOffset
in interfaceorg.refcodes.mixin.OffsetAccessor
-
getSequence
Retrieves the value from theSequence
property. ATTENTION: The originalSequence
including the read bytes is returned, use thegetOffset()
method to access those bytes not yet being read!- Specified by:
getSequence
in interfaceSequenceAccessor
- Returns:
- The
Sequence
stored by theSequence
property.
-