com.datasalt.pangool.utils
Class Buffer

java.lang.Object
  extended by com.datasalt.pangool.utils.Buffer

public class Buffer
extends Object


Constructor Summary
Buffer()
           
Buffer(int initialCapacity)
           
 
Method Summary
 byte[] getBytes()
           
 int getCapacity()
          Get the capacity, which is the maximum size that could handled without resizing the backing storage.
 int getLength()
          Get the current size of the buffer.
 void setCapacity(int new_cap)
          Change the capacity of the backing storage.
 void setSize(int size)
          Change the size of the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Buffer

public Buffer()

Buffer

public Buffer(int initialCapacity)
Method Detail

getBytes

public byte[] getBytes()

getLength

public int getLength()
Get the current size of the buffer.


setSize

public void setSize(int size)
Change the size of the buffer. The values in the old range are preserved and any new values are undefined. The capacity is changed if it is necessary.

Parameters:
size - The new number of bytes

getCapacity

public int getCapacity()
Get the capacity, which is the maximum size that could handled without resizing the backing storage.

Returns:
The number of bytes

setCapacity

public void setCapacity(int new_cap)
Change the capacity of the backing storage. The data is preserved.

Parameters:
new_cap - The new capacity in bytes.


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.