Actually implement reading byte_arrays
All checks were successful
Build & Test / nix-build (push) Successful in 1m28s

This commit is contained in:
Kodi Craft 2024-10-05 11:35:38 +02:00
parent 80060b1708
commit 3bb8c5286a
Signed by: kodi
GPG Key ID: 69D9EED60B242822

View File

@ -216,6 +216,11 @@ defmodule Amethyst.Minecraft.Read do
{[data | acc], rest, :reversed} {[data | acc], rest, :reversed}
end end
def byte_array({acc, data, :reversed}) do
{[length], rest} = start(data) |> varint |> stop
raw({acc, rest, :reversed}, length)
end
@doc """ @doc """
Reads a varint. `read` tracks the number of bytes read and `nacc` tracks the number being read. Reads a varint. `read` tracks the number of bytes read and `nacc` tracks the number being read.
""" """