Show / Hide Table of Contents

Class ByteBuffer

Represents a bounded buffer. A dedicated thread can send bytes to this buffer (the producer); while another thread can read bytes from this buffer (the consumer).

Inheritance
object
ByteBuffer
Implements
IDisposable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: k8s
Assembly: KubernetesClient.dll
Syntax
public class ByteBuffer : IDisposable
Remarks

This is a producer-consumer problem (or bounded-buffer problem), see https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem

Constructors

View Source

ByteBuffer()

Initializes a new instance of the ByteBuffer class using the default buffer size and limit.

Declaration
public ByteBuffer()
View Source

ByteBuffer(int, int)

Initializes a new instance of the ByteBuffer class.

Declaration
public ByteBuffer(int bufferSize, int maximumSize)
Parameters
Type Name Description
int bufferSize

The initial buffer size.

int maximumSize

The maximum buffer size.

Properties

View Source

AvailableReadableBytes

Gets the amount of bytes availble for reading.

Declaration
public int AvailableReadableBytes { get; }
Property Value
Type Description
int
View Source

AvailableWritableBytes

Gets the amount of bytes available for writing.

Declaration
public int AvailableWritableBytes { get; }
Property Value
Type Description
int
View Source

MaximumSize

Gets the maximum allowed size of the buffer.

Declaration
public int MaximumSize { get; }
Property Value
Type Description
int
View Source

ReadWaterMark

Gets the offset from which the next byte will be read. Increased every time a caller reads data.

Declaration
public int ReadWaterMark { get; }
Property Value
Type Description
int
View Source

Size

Gets the current buffer size.

Declaration
public int Size { get; }
Property Value
Type Description
int
View Source

WriteWaterMark

Gets the offset to which the next byte will be written. Increased every time a caller writes data.

Declaration
public int WriteWaterMark { get; }
Property Value
Type Description
int

Methods

View Source

Dispose()

Declaration
public void Dispose()
View Source

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing
View Source

Read(byte[], int, int)

Reads bytes from the buffer.

Declaration
public int Read(byte[] data, int offset, int count)
Parameters
Type Name Description
byte[] data

The byte array into which to read the data.

int offset

The offset at which to start writing the bytes.

int count

The amount of bytes to read.

Returns
Type Description
int

The total number of bytes read.

View Source

Write(byte[], int, int)

Writes bytes to the buffer.

Declaration
public void Write(byte[] data, int offset, int length)
Parameters
Type Name Description
byte[] data

The source byte array from which to read the bytes.

int offset

The offset of the first byte to copy.

int length

The amount of bytes to copy.

View Source

WriteEnd()

Stops writing data to the buffer, indicating that the end of file has been reached.

Declaration
public void WriteEnd()

Events

View Source

OnResize

The event which is raised when the buffer is resized.

Declaration
public event EventHandler OnResize
Event Type
Type Description
EventHandler

Implements

IDisposable
  • View Source
In this article
Back to top Generated by DocFX