Ejemplo n.º 1
0
        public void WriteToStream(BlockFile_I file, System.IO.Stream stream)
        {
            var blocksSorted = SortBlocks(file);

            for (var i = 0; i < blocksSorted.Count; i++)
            {
                var block = blocksSorted[i];

                XIO.Api.Blocks.WriteToStream(block, stream);
            }
        }
Ejemplo n.º 2
0
        public Block_I IssueBlock(BlockFile_I file, int size)
        {
            var block = XIO.Api.Blocks.CreateBlock(size);

            block.Address = file.Length;

            file.Length += block.Length;

            file.Blocks.Add(block);

            return(block);
        }
Ejemplo n.º 3
0
        private List <Block_I> SortBlocks(BlockFile_I file)
        {
            var copy = new List <Block_I>(file.Blocks.Count);

            for (var i = 0; i < file.Blocks.Count; i++)
            {
                copy.Add(file.Blocks[i]);
            }

            XSorting.Api.Quicksort.Sort(copy, (x, y) => x.Address - y.Address);

            return(copy);
        }