Class TagWriter
Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll
Provides methods for writing NBT tags to a stream.
public class TagWriter : TagIO, IDisposableInheritance
Derived
Implements
Inherited Members
TagIO.BaseStream, TagIO.SwapEndian, TagIO.UseVarInt, TagIO.ZigZagEncoding, TagIO.FormatOptions, TagIO.Dispose(), TagIO.DisposeAsync(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
TagWriter(Stream, FormatOptions, bool)
Creates a new instance of the stream.
public TagWriter(Stream stream, FormatOptions options, bool leaveOpen = false)Parameters
stream Stream
A
options FormatOptions
Bitwise flags to configure how data should be handled for compatibility between different specifications.
leaveOpen bool
to leave the stream object open after disposing the
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()DisposeAsync()
Asynchronously releases the unmanaged resources used by the
public override ValueTask DisposeAsync()Returns
WriteBuilder(TagBuilder)
Convenience method to build and write a
public virtual void WriteBuilder(TagBuilder builder)Parameters
builder TagBuilder
A
WriteByte(ByteTag)
Writes a
public virtual void WriteByte(ByteTag tag)Parameters
tag ByteTag
The
WriteByteArray(ByteArrayTag)
Writes a
public virtual void WriteByteArray(ByteArrayTag tag)Parameters
tag ByteArrayTag
The
WriteCompound(CompoundTag)
Writes a
public virtual void WriteCompound(CompoundTag tag)Parameters
tag CompoundTag
The
WriteDouble(DoubleTag)
Writes a
public virtual void WriteDouble(DoubleTag tag)Parameters
tag DoubleTag
The
WriteEndTag(EndTag?)
public virtual void WriteEndTag(EndTag? tag = null)Parameters
tag EndTag?
WriteFloat(FloatTag)
Writes a
public virtual void WriteFloat(FloatTag tag)Parameters
tag FloatTag
The
WriteInt(IntTag)
Writes a
public virtual void WriteInt(IntTag tag)Parameters
tag IntTag
The
WriteIntArray(IntArrayTag)
Writes a
public virtual void WriteIntArray(IntArrayTag tag)Parameters
tag IntArrayTag
The
WriteList(ListTag)
Writes a
public virtual void WriteList(ListTag tag)Parameters
tag ListTag
The
WriteLong(LongTag)
Writes a
public virtual void WriteLong(LongTag tag)Parameters
tag LongTag
The
WriteLongArray(LongArrayTag)
Writes a
public virtual void WriteLongArray(LongArrayTag tag)Parameters
tag LongArrayTag
The
WriteShort(ShortTag)
Writes a
public virtual void WriteShort(ShortTag tag)Parameters
tag ShortTag
The
WriteString(StringTag)
Writes a
public virtual void WriteString(StringTag tag)Parameters
tag StringTag
The
WriteTag(Tag)
Writes the given
public void WriteTag(Tag tag)Parameters
tag Tag
The
Exceptions
Thrown when the tag type is unrecognized.
WriteTagAsync(Tag)
Asynchronously writes the given
public Task WriteTagAsync(Tag tag)Parameters
tag Tag
The
Returns
Exceptions
Thrown when the tag type is unrecognized.