decodeDraco function

DracoMesh decodeDraco(
  1. Uint8List bytes
)

Decodes bytes, the contents of the buffer view a primitive's KHR_draco_mesh_compression extension points at.

Implementation

DracoMesh decodeDraco(Uint8List bytes) {
  try {
    return _decode(bytes);
  } on RangeError {
    // The cursor's multi-byte reads and every table lookup are bounds-checked
    // by the language rather than by hand. A stream that runs one off the end
    // is truncated or lying about a count, and the caller was promised one
    // kind of exception.
    throw const DracoException(
      'the stream ends, or names something out of range, part way through',
    );
  }
}