public class TLcdConcurrentBuffer extends Object implements ILcdBuffer
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 and Description |
---|
TLcdConcurrentBuffer() |
Modifier and Type | Method and Description |
---|---|
ILcdBufferSegment |
allocateBufferSegment(int aCount)
Allocates a given number of bytes in this ILcdBuffer.
|
byte[] |
getByte()
Not supported by this implementation.
|
int |
getSize()
This implementation always returns
Integer.MAX_VALUE . |
public byte[] getByte() throws UnsupportedOperationException
getByte
in interface ILcdBuffer
UnsupportedOperationException
- always thrown.public int getSize()
Integer.MAX_VALUE
.getSize
in interface ILcdBuffer
Integer.MAX_VALUE
.public ILcdBufferSegment allocateBufferSegment(int aCount) throws IllegalArgumentException
ILcdBuffer
allocateBufferSegment
in interface ILcdBuffer
aCount
- the number of bytes to be allocated. It must not be larger
than the total buffer size.IllegalArgumentException
- when the requested number of bytes is larger
than the full buffer size.