private static void read(LittleEndien stream, byte[] buffer, int length) throws IOException {
        int n = 0;
        while (n < length) {
            int cnt = stream.read(buffer, n, length - n);
            if (cnt < 0) {
                throw new AssetLoadException("Data ended prematurely");
            }
            n += cnt;
        }
    }
Parse a json input stream and returns a {@link JsonObject}
@param stream the stream to parse
@return the JsonObject
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java