Skip to content

Interface ICommonMinecraftBuffer

Namespace: Void.Minecraft.Buffers
Assembly: Void.Minecraft.dll

public interface ICommonMinecraftBuffer

Properties

Length

Returns the length of the source as an integer. It is a read-only property.

int Length { get; }

Property Value

int

Position

Gets or sets the position within a buffer. The position must be between 0 and the length of the source, otherwise an exception is thrown.

int Position { get; set; }

Property Value

int

Methods

Access(int)

Retrieves a span of bytes from the underlying buffer starting at the current position for the specified length. This method does not modify the current position of the buffer.

Span<byte> Access(int length)

Parameters

length int

The number of bytes to retrieve from the current position. Must be non-negative.

Returns

Span<byte>

A representing the specified number of bytes from the current position.

Access(int, int)

Retrieves a span of bytes from the underlying buffer starting at the specified position for the given length.

Span<byte> Access(int position, int length)

Parameters

position int

The starting position in the buffer from which to retrieve the byte span. Must be a non-negative value.

length int

The number of bytes to include in the retrieved span. Must be non-negative.

Returns

Span<byte>

A containing the specified range of bytes.

Seek(int, SeekOrigin)

Advances or sets the current position in the buffer relative to the specified origin.

void Seek(int offset, SeekOrigin origin = SeekOrigin.Current)

Parameters

offset int

The byte offset relative to the origin.

origin SeekOrigin

The point of reference used to obtain the new position.