Package ai.djl.basicdataset.utils
Class DynamicBuffer
- java.lang.Object
-
- ai.djl.basicdataset.utils.DynamicBuffer
-
public class DynamicBuffer extends java.lang.ObjectA float buffer that can dynamically change it's capacity.
-
-
Constructor Summary
Constructors Constructor Description DynamicBuffer()Constructs a new instance ofDynamicBuffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.FloatBuffergetBuffer()Returns aFloatBufferthat contains all the data.intgetLength()Returns the buffer size.DynamicBufferput(float f)Writes the given float into this buffer at the current position.
-
-
-
Method Detail
-
put
public DynamicBuffer put(float f)
Writes the given float into this buffer at the current position.- Parameters:
f- the float to be written- Returns:
- this buffer
-
getBuffer
public java.nio.FloatBuffer getBuffer()
Returns aFloatBufferthat contains all the data.- Returns:
- a
FloatBuffer
-
getLength
public int getLength()
Returns the buffer size.- Returns:
- the buffer size
-
-