Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec.video
Class ByteBuffer

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.codec.video.ByteBuffer

public class ByteBuffer
extends Object

Represents a buffer of native memory with a specific size/capacity which either contains a specific number of bytes of valid data or is free for consumption.

Author:
Lubomir Marinov

Field Summary
 int capacity
          The maximum number of bytes which can be written into the native memory represented by this instance.
 long ptr
          The pointer to the native memory represented by this instance.
 
Constructor Summary
ByteBuffer(int capacity)
          Initializes a new ByteBuffer instance with a specific capacity.
 
Method Summary
 int getLength()
          Gets the number of bytes of valid data that the native memory represented by this instance contains.
 boolean isFree()
          Determines whether this instance is free to be written bytes into.
 void setFree(boolean free)
          Sets the indicator which determines whether this instance is free to be written bytes into.
 void setLength(int length)
          Sets the number of bytes of valid data that the native memory represented by this instance contains.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

capacity

public final int capacity
The maximum number of bytes which can be written into the native memory represented by this instance.


ptr

public final long ptr
The pointer to the native memory represented by this instance.

Constructor Detail

ByteBuffer

public ByteBuffer(int capacity)
Initializes a new ByteBuffer instance with a specific capacity.

Parameters:
capacity - the maximum number of bytes which can be written into the native memory represented by the new instance
Method Detail

getLength

public int getLength()
Gets the number of bytes of valid data that the native memory represented by this instance contains.

Returns:
the number of bytes of valid data that the native memory represented by this instance contains

isFree

public boolean isFree()
Determines whether this instance is free to be written bytes into.

Returns:
true if this instance is free to be written bytes into or false is the native memory represented by this instance is already is use

setFree

public void setFree(boolean free)
Sets the indicator which determines whether this instance is free to be written bytes into.

Parameters:
free - true if this instance is to be made available for writing bytes into; otherwise, false

setLength

public void setLength(int length)
Sets the number of bytes of valid data that the native memory represented by this instance contains.

Parameters:
length - the number of bytes of valid data that the native memory represented by this instance contains

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.