Class TLcdBuffer

java.lang.Object
com.luciad.util.TLcdBuffer
All Implemented Interfaces:
ILcdBuffer

public class TLcdBuffer extends Object implements ILcdBuffer
This class provides an implementation of ILcdBuffer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TLcdBuffer(int aSize)
    Creates a new TLcdBuffer capable of storing a given number of bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Allocates a given number of bytes in this ILcdBuffer.
    byte[]
    Returns the bytes in this ILcdBuffer.
    int
    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 this TLcdBuffer.
    void
    releaseMemory(int aSize)
    Release the memory used by this TLcdBuffer reducing its current usage to a maximum of aSize 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdBuffer

      public TLcdBuffer(int aSize)
      Creates a new TLcdBuffer 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 is true 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 either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false 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.
      Returns true 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 interface ILcdBuffer
      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 property allocateFullBufferSize.
      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 interface ILcdBuffer
      Returns:
      the bytes in this ILcdBuffer.
    • allocateBufferSegment

      public ILcdBufferSegment allocateBufferSegment(int aSize) throws IllegalArgumentException
      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 interface ILcdBuffer
      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 this TLcdBuffer.
    • releaseMemory

      public void releaseMemory(int aSize)
      Release the memory used by this TLcdBuffer reducing its current usage to a maximum of aSize bytes.
      Parameters:
      aSize - the memory usage of the buffer after this method has been called (expressed in bytes).