@Override
    public Object load(AssetInfo assetInfo) throws IOException {
        data.clear();
        LittleEndien stream = new LittleEndien(new DataInputStream(assetInfo.openStream()));
        /* magic */ stream.readInt();

        int version = stream.readInt();
        if (version != 2) {
            logger.log(Level.SEVERE, "GlbLoader doesn''t support file version {0}.", version);
            throw new IOException("GLB file version = " + version);
        }

        int length = stream.readInt();

        byte[] json = null;

        //length is the total size, we have to remove the header size (3 integers = 12 bytes).
        length -= 12;

        while (length > 0) {
            int chunkLength = stream.readInt();
            int chunkType = stream.readInt();
            if (chunkType == JSON_TYPE) {
                json = new byte[chunkLength];
                stream.read(json);
            } else {
                byte[] bin = new byte[chunkLength];
                stream.read(bin);
                data.add(bin);
            }
            //8 is the byte size of the 2 ints chunkLength and chunkType.
            length -= chunkLength + 8;
        }

        if (json == null) {
            throw new IOException("No JSON chunk found.");
        }
        return loadFromStream(assetInfo, new ByteArrayInputStream(json));
    }
log diagnostic messages from this class
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GlbLoader.java