Class StreamSegmentMapperImpl
java.lang.Object
com.github.jaiimageio.stream.StreamSegmentMapperImpl
- All Implemented Interfaces:
StreamSegmentMapper
An implementation of the
StreamSegmentMapper interface
that requires an explicit list of the starting locations and
lengths of the source segments.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStreamSegment(long position, int length) Returns aStreamSegmentobject indicating the location of the initial portion of a desired segment in the source stream.voidgetStreamSegment(long position, int length, StreamSegment seg) Sets the values of aStreamSegmentobject indicating the location of the initial portion of a desired segment in the source stream.(package private) longlength()
-
Field Details
-
segmentPositions
private long[] segmentPositions -
segmentLengths
private int[] segmentLengths
-
-
Constructor Details
-
StreamSegmentMapperImpl
public StreamSegmentMapperImpl(long[] segmentPositions, int[] segmentLengths)
-
-
Method Details
-
getStreamSegment
Description copied from interface:StreamSegmentMapperReturns aStreamSegmentobject indicating the location of the initial portion of a desired segment in the source stream. The length of the returnedStreamSegmentmay be smaller than the desired length.- Specified by:
getStreamSegmentin interfaceStreamSegmentMapper- Parameters:
position- The desired starting position in theSegmentedImageInputStream, as along.length- The desired segment length.- Returns:
- a StreamSegment object
-
getStreamSegment
Description copied from interface:StreamSegmentMapperSets the values of aStreamSegmentobject indicating the location of the initial portion of a desired segment in the source stream. The length of the returnedStreamSegmentmay be smaller than the desired length.- Specified by:
getStreamSegmentin interfaceStreamSegmentMapper- Parameters:
position- The desired starting position in theSegmentedImageInputStream, as along.length- The desired segment length.seg- AStreamSegmentobject to be overwritten.
-
length
long length()
-