Package ipsk.io
Class VectorBuffer
- java.lang.Object
- 
- ipsk.io.VectorBuffer
 
- 
 public class VectorBuffer extends java.lang.ObjectA container for byte buffer references. Stores references to dynamically allocated data buffers.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
 
- 
- 
Constructor SummaryConstructors Constructor Description VectorBuffer()Create new empty container.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(byte[] b)Add new buffer reference to container.java.lang.Objectclone()Get a copy of the container.byte[]get(int n)Get reference to n-th buffer in the container.java.util.VectorgetBuffers()Get reference to the buffers.longgetLength()Get total data length.voidremove(int n)Remove buffer reference at index n.intsize()Get number of stored refrences.byte[]toByteArray()Creates byte array and fills it with the data.
 
- 
- 
- 
Method Detail- 
getpublic byte[] get(int n) Get reference to n-th buffer in the container.- Parameters:
- n-
- Returns:
- n-th byte buffer
 
 - 
sizepublic int size() Get number of stored refrences. NOTE: This is not the total size of data.- Returns:
- number of stored refrences
 
 - 
addpublic void add(byte[] b) Add new buffer reference to container.- Parameters:
- b- the new buffer
 
 - 
removepublic void remove(int n) Remove buffer reference at index n.- Parameters:
- n- index
 
 - 
clonepublic java.lang.Object clone() Get a copy of the container. Does not deep copy the data buffers !- Overrides:
- clonein class- java.lang.Object
- Returns:
- clone of the container
 
 - 
getLengthpublic long getLength() Get total data length. The summary of the data length of each referenced buffer.- Returns:
- data length
 
 - 
getBufferspublic java.util.Vector getBuffers() Get reference to the buffers. Returns NO copy of the container.- Returns:
- reference to container
- See Also:
- clone()
 
 - 
toByteArraypublic byte[] toByteArray() Creates byte array and fills it with the data.- Returns:
- contents of buffer as byte array
 
 
- 
 
-