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 } }
public void Set(ArchiveReader archive, byte[] dataVector) { Dispose(); _archive = archive; _archive.AddByteStream(dataVector, 0, dataVector.Length); _needRemove = true; _active = true; }