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
valuebyte[]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
valueisnull.
NbtByteArray(string?)
Creates an NbtByte tag with the given name, containing an empty array of bytes.
public NbtByteArray(string? tagName)
Parameters
tagNamestringName 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
tagNamestringName to assign to this tag. May be
null.valuebyte[]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
valueisnull.
NbtByteArray(NbtByteArray)
Creates a deep copy of given NbtByteArray.
public NbtByteArray(NbtByteArray other)
Parameters
otherNbtByteArrayTag to copy. May not be
null.
Remarks
Byte array of given tag will be cloned.
Exceptions
- ArgumentNullException
otherisnull.
Properties
this[int]
Gets or sets a byte at the given index.
public byte this[int tagIndex] { get; set; }
Parameters
tagIndexintThe zero-based index of the element to get or set.
Property Value
- byte
The byte at the specified index.
Exceptions
- IndexOutOfRangeException
tagIndexis outside the array bounds.
TagType
Type of this tag (ByteArray).
public override NbtTagType TagType { get; }
Property Value
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
valueisnull.
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.