azalea/azalea-nbt
2023-02-09 21:03:16 -06:00
..
benches Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
src Use an ECS (#52) 2023-02-04 19:32:27 -06:00
tests Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
Cargo.toml chore: Release 2023-02-09 21:03:16 -06: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()),
        )]))
    )]))
);