Package org.bouncycastle.crypto.tls
Class ByteQueue
- java.lang.Object
-
- org.bouncycastle.crypto.tls.ByteQueue
-
public class ByteQueue extends java.lang.ObjectDeprecated.Migrate to the (D)TLS API in org.bouncycastle.tls (bctls jar).A queue for bytes. This file could be more optimized.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddData(byte[] buf, int off, int len)Deprecated.Add some data to our buffer.intavailable()Deprecated.voidcopyTo(java.io.OutputStream output, int length)Deprecated.Copy some bytes from the beginning of the data to the providedOutputStream.static intnextTwoPow(int i)Deprecated.voidread(byte[] buf, int offset, int len, int skip)Deprecated.Read data from the buffer.java.io.ByteArrayInputStreamreadFrom(int length)Deprecated.Return aByteArrayInputStreamover some bytes at the beginning of the data.voidremoveData(byte[] buf, int off, int len, int skip)Deprecated.Remove data from the buffer.voidremoveData(int i)Deprecated.Remove some bytes from our data from the beginning.byte[]removeData(int len, int skip)Deprecated.voidshrink()Deprecated.
-
-
-
Method Detail
-
nextTwoPow
public static int nextTwoPow(int i)
Deprecated.- Returns:
- The smallest number which can be written as 2^x which is bigger than i.
-
addData
public void addData(byte[] buf, int off, int len)Deprecated.Add some data to our buffer.- Parameters:
buf- A byte-array to read data from.off- How many bytes to skip at the beginning of the array.len- How many bytes to read from the array.
-
available
public int available()
Deprecated.- Returns:
- The number of bytes which are available in this buffer.
-
copyTo
public void copyTo(java.io.OutputStream output, int length) throws java.io.IOExceptionDeprecated.Copy some bytes from the beginning of the data to the providedOutputStream.- Parameters:
output- TheOutputStreamto copy the bytes to.length- How many bytes to copy.- Throws:
java.io.IOException
-
read
public void read(byte[] buf, int offset, int len, int skip)Deprecated.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.
-
readFrom
public java.io.ByteArrayInputStream readFrom(int length)
Deprecated.Return aByteArrayInputStreamover some bytes at the beginning of the data.- Parameters:
length- How many bytes will be readable.- Returns:
- A
ByteArrayInputStreamover the data.
-
removeData
public void removeData(int i)
Deprecated.Remove some bytes from our data from the beginning.- Parameters:
i- How many bytes to remove.
-
removeData
public void removeData(byte[] buf, int off, int len, int skip)Deprecated.Remove data from the buffer.- Parameters:
buf- The buffer where the removed data will be copied to.off- 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 byte[] removeData(int len, int skip)Deprecated.
-
shrink
public void shrink()
Deprecated.
-
-