Table of Contents

Class ByteQueue

Namespace
Org.BouncyCastle.Tls
Assembly
BouncyCastle.Cryptography.dll

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

public sealed class ByteQueue
Inheritance
ByteQueue
Inherited Members

Constructors

ByteQueue()

public ByteQueue()

ByteQueue(byte[], int, int)

public ByteQueue(byte[] buf, int off, int len)

Parameters

buf byte[]
off int
len int

ByteQueue(int)

public ByteQueue(int capacity)

Parameters

capacity int

Properties

Available

public int Available { get; }

Property Value

int

The number of bytes which are available in this buffer.

Methods

AddData(byte[], int, int)

Add some data to our buffer.

public void AddData(byte[] buf, int off, int len)

Parameters

buf byte[]

A byte-array to read data from.

off int

How many bytes to skip at the beginning of the array.

len int

How many bytes to read from the array.

AddData(ReadOnlySpan<byte>)

public void AddData(ReadOnlySpan<byte> buffer)

Parameters

buffer ReadOnlySpan<byte>

CopyTo(Stream, int)

Copy some bytes from the beginning of the data to the provided Stream.

public void CopyTo(Stream output, int length)

Parameters

output Stream

The Stream to copy the bytes to.

length int

How many bytes to copy.

Read(byte[], int, int, int)

Read data from the buffer.

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

Parameters

buf byte[]

The buffer where the read data will be copied to.

offset int

How many bytes to skip at the beginning of buf.

len int

How many bytes to read at all.

skip int

How many bytes from our data to skip.

Read(Span<byte>, int)

public void Read(Span<byte> buffer, int skip)

Parameters

buffer Span<byte>
skip int

ReadInt32()

public int ReadInt32()

Returns

int

ReadUint16(int)

public int ReadUint16(int skip)

Parameters

skip int

Returns

int

ReadUint8(int)

public short ReadUint8(int skip)

Parameters

skip int

Returns

short

RemoveData(byte[], int, int, int)

Remove data from the buffer.

public void RemoveData(byte[] buf, int off, int len, int skip)

Parameters

buf byte[]

The buffer where the removed data will be copied to.

off int

How many bytes to skip at the beginning of buf.

len int

How many bytes to read at all.

skip int

How many bytes from our data to skip.

RemoveData(int)

Remove some bytes from our data from the beginning.

public void RemoveData(int i)

Parameters

i int

How many bytes to remove.

RemoveData(int, int)

public byte[] RemoveData(int len, int skip)

Parameters

len int
skip int

Returns

byte[]

RemoveData(Span<byte>, int)

public void RemoveData(Span<byte> buffer, int skip)

Parameters

buffer Span<byte>
skip int

Shrink()

public void Shrink()