public void Write(Stream hs) { // Number of UnPacked Streams in Folders if (NumUnPackStreamsTotal != unPackInfo.NumFolders && NumUnPackStreamsInFolders.Any()) { hs.WriteByte((Byte)PropertyID.kNumUnPackStream); for (long i = 0; i < NumUnPackStreamsInFolders.LongLength; ++i) { hs.WriteEncodedUInt64(NumUnPackStreamsInFolders[i]); } } // UnPackSizes if (UnPackSizes.Any()) { hs.WriteByte((Byte)PropertyID.kSize); List <UInt64> .Enumerator u = UnPackSizes.GetEnumerator(); for (long i = 0; i < NumUnPackStreamsInFolders.LongLength; ++i) { for (ulong j = 1; j < NumUnPackStreamsInFolders[i]; ++j) { if (!u.MoveNext()) { throw new SevenZipException("Missing `SubStreamInfo.UnPackSize` entry."); } hs.WriteEncodedUInt64(u.Current); } u.MoveNext(); // skip the `unneeded` one } } // Digests [Number of unknown CRCs] if (Digests.NumDefined() > 0) { hs.WriteByte((Byte)PropertyID.kCRC); Digests.Write(hs); } hs.WriteByte((Byte)PropertyID.kEnd); }
public void Write(Stream hs) { hs.WriteEncodedUInt64(PackPos); hs.WriteEncodedUInt64(NumPackStreams); hs.WriteByte((Byte)PropertyID.kSize); for (ulong i = 0; i < NumPackStreams; ++i) { hs.WriteEncodedUInt64(Sizes[i]); } if (Digests.NumDefined() > 0) { hs.WriteByte((Byte)PropertyID.kCRC); Digests.Write(hs); } hs.WriteByte((Byte)PropertyID.kEnd); }