Package gov.nih.mipav.model.dicomcomm
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 java.lang.ObjectSimple 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 intbufferSizeThe total capacity of the buffer.byte[]dataThe byte type data buffer.(package private) static intDEFAULT_SIZEStatic indicating the default size of the byte buffer.intendIndexPointer to the end of data in the buffer.intstartIndexPoints 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 voidallocateMemory(int size)Method that actually allocates the memory.protected voidfinalize()Prepares this class for destruction.intlength()This method returns the length of valid data in the array.
-
-
-
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;
-
-
Method Detail
-
finalize
protected void finalize()
Prepares this class for destruction.- Overrides:
finalizein classjava.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
-
-