NbtWriter class
A byte writer used to serialize NBT data into binary files.
Constructors
- NbtWriter({NbtCompression nbtCompression = NbtCompression.none})
- Create a new NbtWriter.
Properties
- bytesBuilder ↔ BytesBuilder
-
getter/setter pairinherited
- getBytes → Uint8List
-
Flush and re-allocate new bytes, while
saving the old bytes and returning them.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- nbtCompression ↔ NbtCompression
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setEndianness ← Endian
-
no getterinherited
- writeByteData ↔ ByteData
-
getter/setter pairinherited
- writePosition ↔ int
-
getter/setter pairinherited
Methods
-
allocate(
) → void -
Allocate a new ByteData with 1Megabyte of data.
inherited
-
flush(
int offset) → void -
Flush the data inside of
_curByteData
into the_bytesBuilder
and allocate a new 1MB of data to_curByteData
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
NbtCompound< NbtTag> data) → List<int> -
Write the given
data
compound into a list of bytes. See writeFile on how to quickly write to a file. Remember that on Bedrock, all NBT files will have to be written with Endian.little. -
writeByte(
int value, {bool signed = false}) → void -
Write a single byte.
inherited
-
writeBytes(
List< int> bytes) → void -
inherited
-
writeDouble(
double value) → void -
Write a single 8 byte double precision floating point number.
inherited
-
writeFile(
String path, NbtCompound< NbtTag> data) → Future<void> -
Writes the given
data
compound to the file located atpath
. This method only works on native platforms, so every platform that includes support for 'dart:io'. -
writeFloat(
double value) → void -
Write a single 4 byte single precision floating point number.
inherited
-
writeInt(
int value, {bool signed = false}) → void -
Write a single 4 byte integer.
inherited
-
writeLong(
int value, {bool signed = false}) → void -
Write a single 8 byte long.
inherited
-
writeShort(
int value, {bool signed = false}) → void -
Write a single 2 byte short.
inherited
-
writeString(
String? value) → void -
Write a modified UTF-8 String. This includes writing its length
as a single short integer.
inherited
-
writeVarLong(
int value, {bool signed = false}) → void -
Write a single 8 byte variable length long.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited