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 TypeMethodDescriptionboolean
enlarge
(int aNumberOfBytes) Returns if the buffer segment could be enlarged with the specified size.Returns theILcdBuffer
to which thisILcdBufferSegment
is associated.int
Returns the index of the first byte of thisILcdBufferSegment
in itsILcdBuffer
, or -1 if no bytes are allocated.int
getSize()
Returns the number of bytes occupied by thisILcdBufferSegment
in itsILcdBuffer
.boolean
isValid()
Returns if the buffer segment is still valid.
-
Method Details
-
getBuffer
ILcdBuffer getBuffer()Returns theILcdBuffer
to which thisILcdBufferSegment
is associated.- Returns:
- the
ILcdBuffer
to which thisILcdBufferSegment
is associated.
-
getOffset
int getOffset()Returns the index of the first byte of thisILcdBufferSegment
in itsILcdBuffer
, or -1 if no bytes are allocated.- Returns:
- the index of the first byte of this
ILcdBufferSegment
in itsILcdBuffer
, or -1 if no bytes are allocated.
-
getSize
int getSize()Returns the number of bytes occupied by thisILcdBufferSegment
in itsILcdBuffer
.- Returns:
- the number of bytes occupied by this
ILcdBufferSegment
in 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
aNumberOfBytes
bytes.
-