org.bouncycastle.crypto.tls
Class ByteQueue
java.lang.Objectorg.bouncycastle.crypto.tls.ByteQueue
public class ByteQueue
extends java.lang.Object
A queue for bytes.
This file could be more optimized.
void | addData(byte[] data, int offset, int len)- Add some data to our buffer.
|
static int | nextTwoPow(int i)
|
void | read(byte[] buf, int offset, int len, int skip)- Read data from the buffer.
|
void | removeData(int i)- Remove some bytes from our data from the beginning.
|
int | size()
|
addData
public void addData(byte[] data,
int offset,
int len) Add some data to our buffer.
data - A byte-array to read data from.offset - How many bytes to skip at the beginning of the array.len - How many bytes to read from the array.
nextTwoPow
public static final int nextTwoPow(int i)
- The smallest number which can be written as 2^x which is
bigger than i.
read
public void read(byte[] buf,
int offset,
int len,
int skip) Read data from the buffer.
buf - The buffer where the read data will be copied to.offset - How many bytes to skip at the beginning of buf.len - How many bytes to read at all.skip - How many bytes from our data to skip.
removeData
public void removeData(int i)
Remove some bytes from our data from the beginning.
i - How many bytes to remove.
size
public int size()
- The number of bytes which are available in this buffer.