コード例 #1
0
        public void Read(BinaryReader reader)
        {
            reader.BaseStream.Seek(_Offset, SeekOrigin.Begin);
            while (reader.BaseStream.Position < _Offset + _Length)
            {
                switch (reader.ReadByte())
                {
                case 0:
                    reader.ReadByte();
                    break;

                case 1:
                {
                    short  count = reader.ReadInt16();
                    byte[] array = reader.ReadBytes(count);
                    break;
                }

                case 2:
                {
                    int size = reader.ReadInt32();
                    _DescriptorOffsets = new FileOffsetCollection();
                    _DescriptorOffsets.Read(reader, GetOffsetsCount(size, PieceDescriptor.Size));
                    _Descriptors = ReadDescriptors(reader, GetDescriptorsCount(size, PieceDescriptor.Size));
                    break;
                }
                }
            }
        }
コード例 #2
0
 public void AddRange(FileOffsetCollection offsets)
 {
     base.InnerList.AddRange(offsets);
 }