Class DICOM_Comms.ByteBuffer

  • Enclosing class:
    DICOM_Comms

    protected class DICOM_Comms.ByteBuffer
    extends java.lang.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 bufferSize
      The total capacity of the buffer.
      byte[] data
      The byte type data buffer.
      (package private) static int DEFAULT_SIZE
      Static indicating the default size of the byte buffer.
      int endIndex
      Pointer to the end of data in the buffer.
      int startIndex
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void allocateMemory​(int size)
      Method that actually allocates the memory.
      protected void finalize()
      Prepares this class for destruction.
      int length()
      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 Detail

      • DEFAULT_SIZE

        static final int DEFAULT_SIZE
        Static indicating the default size of the byte buffer.
        See Also:
        Constant Field Values
      • 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 Detail

      • ByteBuffer

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

      • finalize

        protected void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class java.lang.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