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
Simple inner class to facilitate the memory allocation of of a byte buffer used in DICOM_Comms to support I/O.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe total capacity of the buffer.byte[]The byte type data buffer.(package private) static final intStatic indicating the default size of the byte buffer.intPointer to the end of data in the buffer.intPoints the start of data in the buffer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallocateMemory(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 Details
-
DEFAULT_SIZE
static final int DEFAULT_SIZEStatic indicating the default size of the byte buffer.- See Also:
-
bufferSize
public int bufferSizeThe total capacity of the buffer. -
data
public byte[] dataThe byte type data buffer. -
endIndex
public int endIndexPointer to the end of data in the buffer. Default = -1. -
startIndex
public int startIndexPoints 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. -
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
-