org.kc7bfi.jflac.util
Class ByteData

java.lang.Object
  extended by org.kc7bfi.jflac.util.ByteData

public class ByteData
extends java.lang.Object

Expandable byte data storage.


Constructor Summary
ByteData(int maxSpace)
          The default constructor.
 
Method Summary
 void append(byte b)
          Append byte to storage.
 byte[] getData()
           
 byte getData(int idx)
          Return a data byte.
 int getLen()
           
 void setLen(int len)
          Set the length of this ByteData object without re-allocating the underlying array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteData

public ByteData(int maxSpace)
The default constructor.

Parameters:
maxSpace - The maximum space in the internal byte array.
Method Detail

append

public void append(byte b)
Append byte to storage.

Parameters:
b - byte to extend

getData

public byte[] getData()
Returns:
Returns the data.

getData

public byte getData(int idx)
Return a data byte.

Parameters:
idx - The data byte to return
Returns:
Returns the data.

getLen

public int getLen()
Returns:
Returns the len.

setLen

public void setLen(int len)
Set the length of this ByteData object without re-allocating the underlying array. It is not possible to set the length larger than the underlying byte array.