private static VideoFingerPrintWrapper Convert(VideoFingerPrint?videoFingerPrint)
        {
            VideoFingerPrint videoFingerPrintNotNull = TypeUtils.NullThrows(videoFingerPrint);
            IEnumerable <FrameFingerPrintWrapper> frameFingerPrints = from i in Enumerable.Range(0, videoFingerPrintNotNull.FrameFingerPrintsLength)
                                                                      select Convert(videoFingerPrintNotNull.FrameFingerPrints(i));

            return(new VideoFingerPrintWrapper
            {
                FilePath = videoFingerPrintNotNull.FilePath,
                FingerPrints = frameFingerPrints.ToArray(),
            });
        }
        private static Offset <VideoFingerPrint>[] CreateVideoFingerPrintArray(VideoFingerPrintDatabaseWrapper database, FlatBufferBuilder builder)
        {
            int videoFingerPrintCounter = 0;
            var videoFingerPrintArray   = new Offset <VideoFingerPrint> [database.VideoFingerPrints.Length];

            foreach (VideoFingerPrintWrapper videoFingerPrint in database.VideoFingerPrints)
            {
                // NOTE: Do not reorder these statements
                Offset <FrameFingerPrint>[] frameFingerPrintArray = CreateFrameFingerPrintArray(builder, videoFingerPrint);

                StringOffset videoFilePath = builder.CreateString(videoFingerPrint.FilePath);
                VectorOffset frameFingerPrintVectorOffset = VideoFingerPrint.CreateFrameFingerPrintsVector(builder, frameFingerPrintArray);

                VideoFingerPrint.StartVideoFingerPrint(builder);
                VideoFingerPrint.AddFilePath(builder, videoFilePath);
                VideoFingerPrint.AddFrameFingerPrints(builder, frameFingerPrintVectorOffset);

                videoFingerPrintArray[videoFingerPrintCounter] = VideoFingerPrint.EndVideoFingerPrint(builder);
                videoFingerPrintCounter++;
            }

            return(videoFingerPrintArray);
        }