Implementation is based on the work done by kig on Datastream.js. This version is tailored to the use of the t3d library.
import Parser from "@t3d/parser";
import definitions from "@t3d/definitions";
const AMSPParser = new Parser(definitions.AMSP);
const myBuffer = Buffer.from(/** opened chunk**/);
const parsedChunk = AMSPParser.parse(myBuffer); // Chunk will be automatically typed 🎉