Class DICOM_Comms.ByteBuffer

java.lang.Object
gov.nih.mipav.model.dicomcomm.DICOM_Comms.ByteBuffer
Enclosing class:
DICOM_Comms

protected class DICOM_Comms.ByteBuffer extends Object
Simple inner class to facilitate the memory allocation of of a byte buffer used in DICOM_Comms to support I/O.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The total capacity of the buffer.
    byte[]
    The byte type data buffer.
    (package private) static final int
    Static indicating the default size of the byte buffer.
    int
    Pointer to the end of data in the buffer.
    int
    Points the start of data in the buffer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteBuffer(int size)
    Allocates the byte buffer of the given size.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    allocateMemory(int size)
    Method that actually allocates the memory.
    protected void
    Prepares this class for destruction.
    int
    This method returns the length of valid data in the array.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_SIZE

      static final int DEFAULT_SIZE
      Static indicating the default size of the byte buffer.
      See Also:
    • bufferSize

      public int bufferSize
      The total capacity of the buffer.
    • data

      public byte[] data
      The byte type data buffer.
    • endIndex

      public int endIndex
      Pointer to the end of data in the buffer. Default = -1.
    • startIndex

      public int startIndex
      Points the start of data in the buffer. Default = 0;
  • Constructor Details

    • ByteBuffer

      public ByteBuffer(int size)
      Allocates the byte buffer of the given size.
      Parameters:
      size - size of byte buffer to allocate
  • Method Details

    • finalize

      protected void finalize()
      Prepares this class for destruction.
      Overrides:
      finalize in class Object
    • length

      public int length()
      This method returns the length of valid data in the array. Not the total capacity of the array.
      Returns:
      The length of data stored in the array.
    • allocateMemory

      public void allocateMemory(int size)
      Method that actually allocates the memory.
      Parameters:
      size - size of byte buffer to allocate