Package com.luciad.util
Class TLcdBuffer
java.lang.Object
com.luciad.util.TLcdBuffer
- All Implemented Interfaces:
ILcdBuffer
This class provides an implementation of
ILcdBuffer
.-
Constructor Summary
ConstructorDescriptionTLcdBuffer
(int aSize) Creates a newTLcdBuffer
capable of storing a given number of bytes. -
Method Summary
Modifier and TypeMethodDescriptionallocateBufferSegment
(int aSize) Allocates a given number of bytes in this ILcdBuffer.byte[]
getByte()
Returns the bytes in this ILcdBuffer.int
getSize()
Returns the number of bytes in the buffer.boolean
Returns whether the buffer will be allocated with its maximum size or progressively.boolean
Deprecated.This method has been deprecated.void
Release the memory used by thisTLcdBuffer
.void
releaseMemory
(int aSize) Release the memory used by thisTLcdBuffer
reducing its current usage to a maximum ofaSize
bytes.void
setAllocateFullBufferSize
(boolean aAllocateFullBufferSize) Sets whether the buffer will be allocated with its maximum size or progressively.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setSize
(int aSize) Sets the maximum size of this buffer (in bytes).void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.
-
Constructor Details
-
TLcdBuffer
public TLcdBuffer(int aSize) Creates a newTLcdBuffer
capable of storing a given number of bytes.- Parameters:
aSize
- the size of the buffer, expressed in bytes.
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getSize
public int getSize()Description copied from interface:ILcdBuffer
Returns the number of bytes in the buffer.- Specified by:
getSize
in interfaceILcdBuffer
- Returns:
- the number of bytes in the buffer.
-
setSize
public void setSize(int aSize) Sets the maximum size of this buffer (in bytes).- Parameters:
aSize
- the size of the buffer (in bytes).- See Also:
-
setAllocateFullBufferSize
public void setAllocateFullBufferSize(boolean aAllocateFullBufferSize) Sets whether the buffer will be allocated with its maximum size or progressively. If true the maximum buffer size will be allocated upon the first time a buffer segment is requested, otherwise the size of the buffer will grow progressively as needed.- Parameters:
aAllocateFullBufferSize
- the new value for the propertyallocateFullBufferSize
.- See Also:
-
isAllocateFullBufferSize
public boolean isAllocateFullBufferSize()Returns whether the buffer will be allocated with its maximum size or progressively.- Returns:
- whether the buffer will be allocated with its maximum size or progressively.
- See Also:
-
getByte
public byte[] getByte()Description copied from interface:ILcdBuffer
Returns the bytes in this ILcdBuffer.- Specified by:
getByte
in interfaceILcdBuffer
- Returns:
- the bytes in this ILcdBuffer.
-
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:
aSize
- 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.
-
releaseMemory
public void releaseMemory()Release the memory used by thisTLcdBuffer
. -
releaseMemory
public void releaseMemory(int aSize) Release the memory used by thisTLcdBuffer
reducing its current usage to a maximum ofaSize
bytes.- Parameters:
aSize
- the memory usage of the buffer after this method has been called (expressed in bytes).
-