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
ConstructorsConstructorDescriptionTLcdBuffer(int aSize) Creates a newTLcdBuffercapable 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.intgetSize()Returns the number of bytes in the buffer.booleanReturns whether the buffer will be allocated with its maximum size or progressively.booleanDeprecated.This method has been deprecated.voidRelease the memory used by thisTLcdBuffer.voidreleaseMemory(int aSize) Release the memory used by thisTLcdBufferreducing its current usage to a maximum ofaSizebytes.voidsetAllocateFullBufferSize(boolean aAllocateFullBufferSize) Sets whether the buffer will be allocated with its maximum size or progressively.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetSize(int aSize) Sets the maximum size of this buffer (in bytes).voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.
-
Constructor Details
-
TLcdBuffer
public TLcdBuffer(int aSize) Creates a newTLcdBuffercapable 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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif 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:ILcdBufferReturns the number of bytes in the buffer.- Specified by:
getSizein 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:ILcdBufferReturns the bytes in this ILcdBuffer.- Specified by:
getBytein interfaceILcdBuffer- Returns:
- the bytes in this ILcdBuffer.
-
allocateBufferSegment
Description copied from interface:ILcdBufferAllocates a given number of bytes in this ILcdBuffer. Other buffer segments may be de-allocated as required to make space.- Specified by:
allocateBufferSegmentin 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 thisTLcdBufferreducing its current usage to a maximum ofaSizebytes.- Parameters:
aSize- the memory usage of the buffer after this method has been called (expressed in bytes).
-