public class

ByteQueue

extends Object
java.lang.Object
   ↳ org.bouncycastle.crypto.tls.ByteQueue

Class Overview

A queue for bytes. This file could be more optimized.

Summary

Public Constructors
ByteQueue()
Public Methods
void addData(byte[] data, int offset, int len)
Add some data to our buffer.
final 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()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ByteQueue ()

Public Methods

public void addData (byte[] data, int offset, int len)

Add some data to our buffer.

Parameters
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.

public static final int nextTwoPow (int i)

Returns
  • The smallest number which can be written as 2^x which is bigger than i.

public void read (byte[] buf, int offset, int len, int skip)

Read data from the buffer.

Parameters
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.

public void removeData (int i)

Remove some bytes from our data from the beginning.

Parameters
i How many bytes to remove.

public int size ()

Returns
  • The number of bytes which are available in this buffer.