Package com.luciad.util
Interface ILcdBufferSegment
public interface ILcdBufferSegment
An
ILcdBufferSegment defines a segment of an ILcdBuffer.
A segment is specified by the index of its first byte and by its size, expressed
in bytes.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanenlarge(int aNumberOfBytes) Returns if the buffer segment could be enlarged with the specified size.Returns theILcdBufferto which thisILcdBufferSegmentis associated.intReturns the index of the first byte of thisILcdBufferSegmentin itsILcdBuffer, or -1 if no bytes are allocated.intgetSize()Returns the number of bytes occupied by thisILcdBufferSegmentin itsILcdBuffer.booleanisValid()Returns if the buffer segment is still valid.
-
Method Details
-
getBuffer
ILcdBuffer getBuffer()Returns theILcdBufferto which thisILcdBufferSegmentis associated.- Returns:
- the
ILcdBufferto which thisILcdBufferSegmentis associated.
-
getOffset
int getOffset()Returns the index of the first byte of thisILcdBufferSegmentin itsILcdBuffer, or -1 if no bytes are allocated.- Returns:
- the index of the first byte of this
ILcdBufferSegmentin itsILcdBuffer, or -1 if no bytes are allocated.
-
getSize
int getSize()Returns the number of bytes occupied by thisILcdBufferSegmentin itsILcdBuffer.- Returns:
- the number of bytes occupied by this
ILcdBufferSegmentin itsILcdBuffer. Note that the buffer may have invalidated this ILcdBufferSegment to make space for other segments. In that case, 0 will be returned.
-
isValid
boolean isValid()Returns if the buffer segment is still valid.- Returns:
- true if the buffer segment is still valid, false otherwise. A buffer segment may become invalid because more recently allocated buffer segments have taken over its buffer space.
-
enlarge
boolean enlarge(int aNumberOfBytes) Returns if the buffer segment could be enlarged with the specified size.- Parameters:
aNumberOfBytes- the number of bytes to enlarge the buffer segment with if possible. Calling this method should only be done on the last allocatedILcdBufferSegment. Note that the offset can be changed as a result.- Returns:
- true if the buffer segment could be enlarged with
aNumberOfBytesbytes.
-