Package com.github.jaiimageio.stream
Class StreamSegment
- java.lang.Object
-
- com.github.jaiimageio.stream.StreamSegment
-
public class StreamSegment extends java.lang.Object
A utility class representing a segment within a stream as along
starting position and anint
length.
-
-
Field Summary
Fields Modifier and Type Field Description private int
segmentLength
private long
startPos
-
Constructor Summary
Constructors Constructor Description StreamSegment()
Constructs aStreamSegment
.StreamSegment(long startPos, int segmentLength)
Constructs aStreamSegment
with a given starting position and length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSegmentLength()
Returns the length of the segment.long
getStartPos()
Returns the starting position of the segment.void
setSegmentLength(int segmentLength)
Sets the length of the segment.void
setStartPos(long startPos)
Sets the starting position of the segment.
-
-
-
Constructor Detail
-
StreamSegment
public StreamSegment()
Constructs aStreamSegment
. The starting position and length are set to 0.
-
StreamSegment
public StreamSegment(long startPos, int segmentLength)
Constructs aStreamSegment
with a given starting position and length.- Parameters:
startPos
- The initial position of the segment.segmentLength
- The length of the segment.
-
-
Method Detail
-
getStartPos
public final long getStartPos()
Returns the starting position of the segment.- Returns:
- The initial position of the segment.
- See Also:
setStartPos(long)
-
setStartPos
public final void setStartPos(long startPos)
Sets the starting position of the segment.- Parameters:
startPos
- The initial position of the segment.- See Also:
getStartPos()
-
getSegmentLength
public final int getSegmentLength()
Returns the length of the segment.- Returns:
- The length of the segment.
- See Also:
setSegmentLength(int)
-
setSegmentLength
public final void setSegmentLength(int segmentLength)
Sets the length of the segment.- Parameters:
segmentLength
- The length of the segment.- See Also:
getSegmentLength()
-
-