Пример #1
0
        public void Set(ArchiveReader archive, List<byte[]> dataVector)
        {
            Dispose();
            _active = true;

            byte external = archive.ReadByte();
            if (external != 0)
            {
                int dataIndex = archive.ReadNum();
                if (dataIndex < 0 || dataIndex >= dataVector.Count)
                    throw new InvalidOperationException();

            #if DEBUG
                Log.WriteLine("[switch to stream {0}]", dataIndex);
            #endif
                _archive = archive;
                _archive.AddByteStream(dataVector[dataIndex], 0, dataVector[dataIndex].Length);
                _needRemove = true;
                _active = true;
            }
            else
            {
            #if DEBUG
                Log.WriteLine("[inline data]");
            #endif
            }
        }
Пример #2
0
 public void Set(ArchiveReader archive, List<byte[]> dataVector)
 {
     this.Dispose();
     this._active = true;
     if (archive.ReadByte() != 0)
     {
         int num2 = archive.ReadNum();
         if ((num2 < 0) || (num2 >= dataVector.Count))
         {
             throw new InvalidOperationException();
         }
         Log.WriteLine("[switch to stream {0}]", new object[] { num2 });
         this._archive = archive;
         this._archive.AddByteStream(dataVector[num2], 0, dataVector[num2].Length);
         this._needRemove = true;
         this._active = true;
     }
     else
     {
         Log.WriteLine("[inline data]");
     }
 }