Maven module :un.api : api-common :
Class : un.api.collection.primitive.ByteSequence
Extends/Implements : un.api.collection.AbstractSequence un.api.collection.primitive.PrimitiveSequence
Subclasses : -

author  Johann Sorel


Variables : -
Functions : ByteSequence, ByteSequence, skip, skip, put, put, put, getBackArray, toArrayByte, toArray, read, read, startWidth, startWidth, endWidth, endWidth, trimStart, trimEnd, getSize, removeAll, moveTo, removeNext, insert, insert, insert, get, add, remove



public void ByteSequence ()

public void ByteSequence (byte[] buffer)


move one byte ahead preserving buffer value or
filling it with zero if buffer was resized.
public void skip ()


move one byte ahead preserving buffer value or
filling it with zero if buffer was resized.
param  nb
public void skip (int nb)

public void put (byte b)

public void put (byte[] b)

public void put (byte[] b, int offset, int length)


return  the underlying byte array,
it's size might be larger then the current buffer size.
public byte[] getBackArray ()


return  byte array
public byte[] toArrayByte ()

public Object[] toArray ()

public byte read (int index)

public int read (int index, byte[] buffer, int offset, int length)


Test if byte buffer starts by a given array.
param  buffer start array
return  true if the buffer starts with the given serie of bytes.
public boolean startWidth (byte[] buffer)


Test if byte buffer starts by a given array.
param  buffer start array
param  offset start offset
param  length number of elements to test
return  true if the buffer starts with the given serie of bytes.
public boolean startWidth (byte[] buffer, int offset, int length)


Test if byte buffer ends by a given array.
param  buffer end array
return  true if the buffer ends with the given serie of bytes.
public boolean endWidth (byte[] buffer)


Test if byte buffer ends by a given array.
param  buffer end array
param  offset end offset
param  length number of elements to test
return  true if the buffer ends with the given serie of bytes.
public boolean endWidth (byte[] buffer, int offset, int length)


Remove given number of bytes at buffer start.
param  nbbyte number of bytes to remove
public void trimStart (int nbbyte)


Remove given number of bytes at buffer end.
param  nbbyte number of bytes to remove
public void trimEnd (int nbbyte)

public int getSize ()

public boolean removeAll ()

public ByteSequence moveTo (int position)


Remove the N next elements.
param  nbElement
public boolean removeNext (int nbElement)

public ByteSequence insert (byte b)

public ByteSequence insert (byte[] b)

public ByteSequence insert (byte[] b, int offset, int length)

public Object get (int index)

public boolean add (int index, Object value)

public boolean remove (int index)