- 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
Constructors Constructor Description SequenceInputStream(Sequence aSequence)Uses the providedSequenceto provideInputStreamfunctionality.SequenceInputStream(Sequence aSequence, int aOffset)Uses the providedSequenceto provideInputStreamfunctionality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()intgetOffset()SequencegetSequence()Retrieves the value from theSequenceproperty.intread()intread(byte[] aChunk, int aOffset, int aLength)-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
SequenceInputStream
public SequenceInputStream(Sequence aSequence)
Uses the providedSequenceto provideInputStreamfunctionality.- Parameters:
aSequence- TheSequenceto use.
-
SequenceInputStream
public SequenceInputStream(Sequence aSequence, int aOffset)
Uses the providedSequenceto provideInputStreamfunctionality.
-
-
Method Detail
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] aChunk, int aOffset, int aLength) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
getOffset
public int getOffset()
- Specified by:
getOffsetin interfaceorg.refcodes.mixin.OffsetAccessor
-
getSequence
public Sequence getSequence()
Retrieves the value from theSequenceproperty. ATTENTION: The originalSequenceincluding the read bytes is returned, use thegetOffset()method to access those bytes not yet being read!- Specified by:
getSequencein interfaceSequenceAccessor- Returns:
- The
Sequencestored by theSequenceproperty.
-
-