public class ByteBuffer
extends java.lang.Object
Constructor and Description |
---|
ByteBuffer(int capacity)
Initializes a new ByteBuffer instance with a specific
capacity of native memory.
|
ByteBuffer(long ptr)
Initializes a new ByteBuffer instance which is to represent a
specific block of native memory.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Frees the native memory represented by this instance if the native memory
has been allocated by this instance and has not been freed yet i.e.
|
void |
free()
Frees the native memory represented by this instance if the native memory
has been allocated by this instance and has not been freed yet.
|
int |
getCapacity()
Gets the maximum number of bytes which may be written into the native
memory represented by this instance.
|
int |
getLength()
Gets the number of bytes of valid data that the native memory represented
by this instance contains.
|
long |
getPtr()
Gets the pointer to the native memory represented by this instance.
|
void |
setLength(int length)
Sets the number of bytes of valid data that the native memory represented
by this instance contains.
|
public ByteBuffer(int capacity)
capacity
- the maximum number of bytes which can be written into the
native memory represented by the new instancepublic ByteBuffer(long ptr)
ptr
- a pointer to the block of native memory to be represented by
the new instanceprotected void finalize() throws java.lang.Throwable
free()
is invoked on this instance.finalize
in class java.lang.Object
java.lang.Throwable
Object.finalize()
public void free()
public int getCapacity()
public int getLength()
public long getPtr()
public void setLength(int length)
length
- the number of bytes of valid data that the native memory
represented by this instance containsjava.lang.IllegalArgumentException
- if length is a negative value
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.