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
ByteQueue(int)
public ByteQueue(int capacity)
Parameters
capacityint
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
bufbyte[]A byte-array to read data from.
offintHow many bytes to skip at the beginning of the array.
lenintHow many bytes to read from the array.
AddData(ReadOnlySpan<byte>)
public void AddData(ReadOnlySpan<byte> buffer)
Parameters
bufferReadOnlySpan<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
Read(byte[], int, int, int)
Read data from the buffer.
public void Read(byte[] buf, int offset, int len, int skip)
Parameters
bufbyte[]The buffer where the read data will be copied to.
offsetintHow many bytes to skip at the beginning of buf.
lenintHow many bytes to read at all.
skipintHow many bytes from our data to skip.
Read(Span<byte>, int)
public void Read(Span<byte> buffer, int skip)
Parameters
ReadInt32()
public int ReadInt32()
Returns
ReadUint16(int)
public int ReadUint16(int skip)
Parameters
skipint
Returns
ReadUint8(int)
public short ReadUint8(int skip)
Parameters
skipint
Returns
RemoveData(byte[], int, int, int)
Remove data from the buffer.
public void RemoveData(byte[] buf, int off, int len, int skip)
Parameters
bufbyte[]The buffer where the removed data will be copied to.
offintHow many bytes to skip at the beginning of buf.
lenintHow many bytes to read at all.
skipintHow many bytes from our data to skip.
RemoveData(int)
Remove some bytes from our data from the beginning.
public void RemoveData(int i)
Parameters
iintHow many bytes to remove.
RemoveData(int, int)
public byte[] RemoveData(int len, int skip)
Parameters
Returns
- byte[]
RemoveData(Span<byte>, int)
public void RemoveData(Span<byte> buffer, int skip)
Parameters
Shrink()
public void Shrink()