private static byte[] TryLoadBase64BinaryBufferUnchecked(Schema.Buffer buffer, string prefix) { if (buffer.Uri == null || !buffer.Uri.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) { return(null); } var content = buffer.Uri.Substring(prefix.Length); return(Convert.FromBase64String(content)); }
private static byte[] LoadBinaryBufferUnchecked(Schema.Buffer buffer, Func <string, byte[]> externalReferenceSolver) { return(TryLoadBase64BinaryBufferUnchecked(buffer, EMBEDDEDGLTFBUFFER) ?? TryLoadBase64BinaryBufferUnchecked(buffer, EMBEDDEDOCTETSTREAM) ?? externalReferenceSolver(buffer?.Uri)); }