Package com.luciad.util
Class TLcdConcurrentBuffer
java.lang.Object
com.luciad.util.TLcdConcurrentBuffer
- All Implemented Interfaces:
ILcdBuffer
This implementation of
ILcdBuffer
relies on java memory allocation and garbage collection.
It doesn't share a single buffer but reallocates a new buffer each time a buffer segment is requested.
The size of allocated segments is only limited by the amount of available memory.
All the methods of the buffer segments provided by the class TLcdConcurrentBuffer
are thread safe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocateBufferSegment
(int aCount) Allocates a given number of bytes in this ILcdBuffer.byte[]
getByte()
Not supported by this implementation.int
getSize()
This implementation always returnsInteger.MAX_VALUE
.
-
Constructor Details
-
TLcdConcurrentBuffer
public TLcdConcurrentBuffer()
-
-
Method Details
-
getByte
Not supported by this implementation.- Specified by:
getByte
in interfaceILcdBuffer
- Returns:
- NA
- Throws:
UnsupportedOperationException
- always thrown.
-
getSize
public int getSize()This implementation always returnsInteger.MAX_VALUE
.- Specified by:
getSize
in interfaceILcdBuffer
- Returns:
Integer.MAX_VALUE
.
-
allocateBufferSegment
Description copied from interface:ILcdBuffer
Allocates a given number of bytes in this ILcdBuffer. Other buffer segments may be de-allocated as required to make space.- Specified by:
allocateBufferSegment
in interfaceILcdBuffer
- Parameters:
aCount
- the number of bytes to be allocated. It must not be larger than the total buffer size.- Returns:
- an ILcdBufferSegment that specifies the allocated space in this ILcdBuffer.
- Throws:
IllegalArgumentException
- when the requested number of bytes is larger than the full buffer size.
-