Package com.github.jaiimageio.stream
Class SectorStreamSegmentMapper
java.lang.Object
com.github.jaiimageio.stream.SectorStreamSegmentMapper
- All Implemented Interfaces:
StreamSegmentMapper
An implementation of the
StreamSegmentMapper
interface
for segments of equal length.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) int
(package private) long[]
(package private) int
-
Constructor Summary
ConstructorsConstructorDescriptionSectorStreamSegmentMapper
(long[] segmentPositions, int segmentLength, int totalLength) -
Method Summary
Modifier and TypeMethodDescriptiongetStreamSegment
(long position, int length) Returns aStreamSegment
object indicating the location of the initial portion of a desired segment in the source stream.void
getStreamSegment
(long position, int length, StreamSegment seg) Sets the values of aStreamSegment
object indicating the location of the initial portion of a desired segment in the source stream.(package private) long
length()
-
Field Details
-
segmentPositions
long[] segmentPositions -
segmentLength
int segmentLength -
totalLength
int totalLength -
lastSegmentLength
int lastSegmentLength
-
-
Constructor Details
-
SectorStreamSegmentMapper
public SectorStreamSegmentMapper(long[] segmentPositions, int segmentLength, int totalLength)
-
-
Method Details
-
getStreamSegment
Description copied from interface:StreamSegmentMapper
Returns aStreamSegment
object indicating the location of the initial portion of a desired segment in the source stream. The length of the returnedStreamSegment
may be smaller than the desired length.- Specified by:
getStreamSegment
in 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:StreamSegmentMapper
Sets the values of aStreamSegment
object indicating the location of the initial portion of a desired segment in the source stream. The length of the returnedStreamSegment
may be smaller than the desired length.- Specified by:
getStreamSegment
in interfaceStreamSegmentMapper
- Parameters:
position
- The desired starting position in theSegmentedImageInputStream
, as along
.length
- The desired segment length.seg
- AStreamSegment
object to be overwritten.
-
length
long length()
-