Godot Version
Godot 4.4.1
Question
Hi,
I’m messing around with ZIPPacker and ZIPReader classes, and they use PackedByteArray for their file data. I don’t understand how to convert the data to and from PackedByteArray form.
The example in the documentation looks very easy:
writer.write_file("Hello World".to_utf8_buffer())
So it makes a string and converts it to utf8. Cool, I can convert my vector data data to string (JSON.stringify) and then to utf8. It works but feels stupid.
Then when loading it:
reader.read_file("somefile").get_string_from_utf8()
I can get the bytes and convert that to string and parse vector data from that… Soo many conversions.
What’s the correct way? My data is just an array of vectors.