Extractor_Serializer.Extractor.SegRead C# (CSharp) Méthode

SegRead() private méthode

The seg read.
///
private SegRead ( uint count, ulong position = 4294967295u ) : byte[]
count uint /// The count. ///
position ulong /// The position. ///
Résultat byte[]
        private byte[] SegRead(uint count, ulong position = 4294967295u)
        {
            if (position != 4294967295u)
            {
                this.DF = (int)Math.Floor(1.0f * position / this.dataFileSize);
                if (this.DF > 0)
                {
                    position = (uint)(position - (this.dataFileSize - this.blockOffset) * (ulong)this.DF);
                }

                this.DATs[this.DF].Position = (uint)position;
            }

            byte[] array = new byte[count];
            int num = this.DATs[this.DF].Read(array, 0, (int)count);
            if (num == -1)
            {
                throw new EndOfStreamException();
            }

            if (num != count)
            {
                this.DATs[++this.DF].Position = this.blockOffset;
                this.DATs[this.DF].Read(array, num, (int)(count - (uint)num));
            }

            return array;
        }