1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 23:44:38 +00:00
azalea/azalea-nbt
2023-01-30 22:05:18 +00:00
..
benches Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
src have docs for all crates 2023-01-30 22:05:18 +00:00
tests Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
Cargo.toml (cargo-release) version 0.5.0 2022-12-09 15:34:26 +00:00
README.md have docs for all crates 2023-01-30 22:05:18 +00:00

Azalea NBT

A fast NBT serializer and deserializer.

Examples

use ahash::AHashMap;
use azalea_nbt::Tag;
use std::{io::{Cursor, Read}, fs::File};

let mut file = File::open("tests/hello_world.nbt").unwrap();
let mut buf = vec![];
file.read_to_end(&mut buf).unwrap();
let tag = Tag::read(&mut Cursor::new(&buf[..])).unwrap();
assert_eq!(
    tag,
    Tag::Compound(AHashMap::from_iter(vec![(
        "hello world".to_string(),
        Tag::Compound(AHashMap::from_iter(vec![(
            "name".to_string(),
            Tag::String("Bananrama".to_string()),
        )]))
    )]))
);