Class BufferedTagWriter
Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll
Provides a
public class BufferedTagWriter : TagWriter, IDisposableInheritance
object ← TagIO ← TagWriter ← BufferedTagWriter
Implements
Inherited Members
TagWriter.WriteByte(ByteTag), TagWriter.WriteShort(ShortTag), TagWriter.WriteInt(IntTag), TagWriter.WriteLong(LongTag), TagWriter.WriteFloat(FloatTag), TagWriter.WriteDouble(DoubleTag), TagWriter.WriteString(StringTag), TagWriter.WriteByteArray(ByteArrayTag), TagWriter.WriteIntArray(IntArrayTag), TagWriter.WriteLongArray(LongArrayTag), TagWriter.WriteList(ListTag), TagWriter.WriteCompound(CompoundTag), TagWriter.WriteBuilder(TagBuilder), TagWriter.WriteEndTag(EndTag?), TagWriter.WriteTag(Tag), TagWriter.WriteTagAsync(Tag), TagWriter.Dispose(), TagWriter.DisposeAsync(), 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()
Properties
Capacity
Gets the capacity of the internal buffer.
public long Capacity { get; }Property Value
Remarks
The capacity will expand automatically as-needed.
Length
Gets the number of bytes in the internal buffer.
public long Length { get; }Property Value
Methods
CopyTo(Stream)
Copies the internal buffer to the specified stream;
public void CopyTo(Stream stream)Parameters
stream Stream
A
CopyToAsync(Stream)
Asynchronously copies the internal buffer to the specified stream;
public Task CopyToAsync(Stream stream)Parameters
stream Stream
A
Returns
Create(CompressionType, FormatOptions)
Creates a new instance of the
public static BufferedTagWriter Create(CompressionType compression, FormatOptions options)Parameters
compression CompressionType
Indicates the compression algorithm used to compress the file.
options FormatOptions
Bitwise flags to configure how data should be handled for compatibility between different specifications.
Returns
A newly created
Exceptions
Thrown when an invalid compression type is specified.
Create(CompressionType, FormatOptions, int)
Creates a new instance of the
public static BufferedTagWriter Create(CompressionType compression, FormatOptions options, int capacity)Parameters
compression CompressionType
Indicates the compression algorithm used to compress the file.
options FormatOptions
Bitwise flags to configure how data should be handled for compatibility between different specifications.
capacity int
The initial capacity of the buffer.
Returns
A newly created
Exceptions
Thrown when an invalid compression type is specified.
ToArray()
Gets the internal buffer as an array of bytes containing the NBT data written so far.
public byte[] ToArray()Returns
byte[]
An array of bytes containing the NBT data.
Operators
implicit operator ReadOnlySpan<byte>(BufferedTagWriter)
Implicit conversion of
public static implicit operator ReadOnlySpan<byte>(BufferedTagWriter writer)Parameters
writer BufferedTagWriter