Package com.github.jaiimageio.stream
Class SectorStreamSegmentMapper
- java.lang.Object
-
- com.github.jaiimageio.stream.SectorStreamSegmentMapper
-
- All Implemented Interfaces:
StreamSegmentMapper
class SectorStreamSegmentMapper extends java.lang.Object implements StreamSegmentMapper
An implementation of theStreamSegmentMapperinterface for segments of equal length.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intlastSegmentLength(package private) intsegmentLength(package private) long[]segmentPositions(package private) inttotalLength
-
Constructor Summary
Constructors Constructor Description SectorStreamSegmentMapper(long[] segmentPositions, int segmentLength, int totalLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamSegmentgetStreamSegment(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()
-
-
-
Method Detail
-
getStreamSegment
public StreamSegment getStreamSegment(long position, int length)
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
public void getStreamSegment(long position, int length, StreamSegment seg)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()
-
-