Skip to content

Class ByteArrayTag

Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll

A tag whose value is a contiguous sequence of 8-bit integers.

public class ByteArrayTag : ArrayTag<byte>, IEquatable<Tag>, ICloneable, IReadOnlyList<byte>, IReadOnlyCollection<byte>, IEnumerable<byte>, IEnumerable

Inheritance

objectTagArrayTag<byte>ByteArrayTag

Implements

IEquatable<Tag>, ICloneable, IReadOnlyList<byte>, IReadOnlyCollection<byte>, IEnumerable<byte>, IEnumerable

Inherited Members

ArrayTag<byte>.Span, ArrayTag<byte>.Memory, ArrayTag<byte>.GetEnumerator(), ArrayTag<byte>.CopyTo(byte[], int), ArrayTag<byte>.Count, ArrayTag<byte>.IndexOf(byte), ArrayTag<byte>.Slice(int, int), ArrayTag<byte>.this[int], ArrayTag<byte>.GetPinnableReference(), Tag.NoName, Tag.Type, Tag.Parent, Tag.Name, Tag.PrettyPrinted(StringBuilder, int, string), Tag.PrettyName, Tag.WriteJson(Utf8JsonWriter, bool), Tag.WriteJson(Stream, JsonWriterOptions?), Tag.WriteJsonAsync(Stream, JsonWriterOptions?), Tag.ToJson(JsonWriterOptions?), Tag.ToJsonString(bool, string), Tag.Equals(Tag?), Tag.Equals(object?), Tag.GetHashCode(), Tag.Clone(), Tag.Stringify(bool), Tag.StringifyName, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

EnumerableExtensions.Synchronized<byte>(IEnumerable<byte>, AsyncLock, CancellationToken), EnumerableExtensions.SynchronizedAsync<byte>(IEnumerable<byte>, AsyncLock, CancellationToken)

Remarks

While this class uses the CLS compliant (0..255), the NBT specification uses a signed value with a range of -128..127, so ensure the bits are equivalent for your values.

Constructors

ByteArrayTag(string?, int)

Initializes a new instance of the .

public ByteArrayTag(string? name, int capacity)

Parameters

name string?

The name of the tag, or null if tag has no name.

capacity int

The capacity of the array.

ByteArrayTag(string?, byte[])

Initializes a new instance of the .

public ByteArrayTag(string? name, byte[] values)

Parameters

name string?

The name of the tag, or null if tag has no name.

values byte[]

A collection of values to include in this tag.

ByteArrayTag(string?, IEnumerable<byte>)

Initializes a new instance of the with the specified values.

public ByteArrayTag(string? name, IEnumerable<byte> values)

Parameters

name string?

The name of the tag, or null if tag has no name.

values IEnumerable<byte>

A collection of values to include in this tag.

ByteArrayTag(string?, ReadOnlySpan<byte>)

Initializes a new instance of the with the specified values.

public ByteArrayTag(string? name, ReadOnlySpan<byte> values)

Parameters

name string?

The name of the tag, or null if tag has no name.

values ReadOnlySpan<byte>

A collection of values to include in this tag.

Methods

Stringify(bool)

Gets the string representation of this NBT tag (SNBT).

public override string Stringify(bool named = true)

Parameters

named bool

Flag indicating if the name of the tag should be written.

Returns

string

This NBT tag in SNBT format.

See Also

https://minecraft.fandom.com/wiki/NBT_format#SNBT_format

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WriteJson(Utf8JsonWriter, bool)

Uses the provided writer to write the NBT tag in JSON format.

protected override void WriteJson(Utf8JsonWriter writer, bool named = true)

Parameters

writer Utf8JsonWriter

A JSON writer instance.

named bool

Flag indicating if this object’s name should be written as a property name, or false when it is a child of , in which case it should be written as a JSON array element.