Table of Contents

Class NbtByteArray

Namespace
fNbt
Assembly
fNbt.dll

A tag containing an array of bytes.

public sealed class NbtByteArray : NbtTag, ICloneable
Inheritance
NbtByteArray
Implements
Inherited Members

Constructors

NbtByteArray()

Creates an unnamed NbtByte tag, containing an empty array of bytes.

public NbtByteArray()

NbtByteArray(byte[])

Creates an unnamed NbtByte tag, containing the given array of bytes.

public NbtByteArray(byte[] value)

Parameters

value byte[]

Byte array to assign to this tag's Value. May not be null.

Remarks

Given byte array will be cloned. To avoid unnecessary copying, call one of the other constructor overloads (that do not take a byte[]) and then set the Value property yourself.

Exceptions

ArgumentNullException

value is null.

NbtByteArray(string?)

Creates an NbtByte tag with the given name, containing an empty array of bytes.

public NbtByteArray(string? tagName)

Parameters

tagName string

Name to assign to this tag. May be null.

NbtByteArray(string?, byte[])

Creates an NbtByte tag with the given name, containing the given array of bytes.

public NbtByteArray(string? tagName, byte[] value)

Parameters

tagName string

Name to assign to this tag. May be null.

value byte[]

Byte array to assign to this tag's Value. May not be null.

Remarks

Given byte array will be cloned. To avoid unnecessary copying, call one of the other constructor overloads (that do not take a byte[]) and then set the Value property yourself.

Exceptions

ArgumentNullException

value is null.

NbtByteArray(NbtByteArray)

Creates a deep copy of given NbtByteArray.

public NbtByteArray(NbtByteArray other)

Parameters

other NbtByteArray

Tag to copy. May not be null.

Remarks

Byte array of given tag will be cloned.

Exceptions

ArgumentNullException

other is null.

Properties

this[int]

Gets or sets a byte at the given index.

public byte this[int tagIndex] { get; set; }

Parameters

tagIndex int

The zero-based index of the element to get or set.

Property Value

byte

The byte at the specified index.

Exceptions

IndexOutOfRangeException

tagIndex is outside the array bounds.

TagType

Type of this tag (ByteArray).

public override NbtTagType TagType { get; }

Property Value

NbtTagType

Value

Value/payload of this tag (an array of bytes). Value is stored as-is and is NOT cloned. May not be null.

public byte[] Value { get; set; }

Property Value

byte[]

Exceptions

ArgumentNullException

value is null.

Methods

Clone()

Creates a deep copy of this tag.

public override object Clone()

Returns

object

A new NbtTag object that is a deep copy of this instance.