NbtReader class
Constructors
- NbtReader(Uint8List list)
- NbtReader.fromFile(String path)
-
Reads the file at
path
in bytes and constructs a new reader with that data. This method only works on native platforms, so every platform that includes support for 'dart:io'.factory
Properties
- data ↔ Uint8List?
-
List of bytes to read.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- nbtCompression ↔ NbtCompression
-
getter/setter pair
- readByteData ↔ ByteData?
-
_data
represented as a ByteData to ease with the reading of various integers and floats.getter/setter pairinherited - readPosition ↔ int
-
The current read position inside of
_byteData
;getter/setter pairinherited -
root
↔ NbtCompound<
NbtTag> ? -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setEndianness ← Endian
-
no getterinherited
Methods
-
getContentEndian(
) → Endian -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
) → NbtCompound< NbtTag> - Reads the NBT data from the byte list. Throws NbtFileReadException if an issue occured.
-
readByte(
{bool signed = false}) → int -
Reads a single byte at readPosition.
inherited
-
readDouble(
{bool signed = false}) → double -
Reads a 8 byte double starting at readPosition.
inherited
-
readFloat(
{bool signed = false}) → double -
Reads a 4 byte float starting at readPosition.
inherited
-
readInt(
{bool signed = false}) → int -
Reads a 4 byte integer starting at readPosition.
inherited
-
readLong(
{bool signed = false}) → int -
Reads a 8 byte integer starting at readPosition.
inherited
-
readShort(
{bool signed = false}) → int -
Reads a 2 byte short starting at readPosition.
inherited
-
readString(
) → String -
Reads a string at readPosition. It will first read
a 2 byte short for the length, then reads length-amount
of bytes and decodes them as UTF-8.
inherited
-
readVarLong(
{bool signed = false}) → Pair< int, int> -
Reads a 8 byte variable length long starting at readPosition.
The format of this long will be as to LEB128, or better what
Minecraft uses.
Returns a Pair, in which the first integer is the read value
and the second the length of the var-integer in bytes.
inherited
-
reset(
Uint8List list) → void -
inherited
-
resetPosition(
) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited