Пример #1
0
        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));
        }
Пример #2
0
 private static byte[] LoadBinaryBufferUnchecked(Schema.Buffer buffer, Func <string, byte[]> externalReferenceSolver)
 {
     return(TryLoadBase64BinaryBufferUnchecked(buffer, EMBEDDEDGLTFBUFFER)
            ?? TryLoadBase64BinaryBufferUnchecked(buffer, EMBEDDEDOCTETSTREAM)
            ?? externalReferenceSolver(buffer?.Uri));
 }