PrepOutputStream() private method

Prepare the given stream for output - wrap it in a CountingStream, and then in a CRC stream, and an encryptor and deflator as appropriate.

Previously this was used in ZipEntry.Write(), but in an effort to introduce some efficiencies in that method I've refactored to put the code inline. This method still gets called by ZipOutputStream.

private PrepOutputStream ( Stream s, long streamLength, CountingStream &outputCounter, Stream &encryptor, Stream &compressor, Ionic &output ) : void
s Stream
streamLength long
outputCounter CountingStream
encryptor Stream
compressor Stream
output Ionic
return void
Ejemplo n.º 1
0
 private void _InitiateCurrentEntry(bool finishing)
 {
     _entriesWritten.Add(_currentEntry.FileName, _currentEntry);
     _entryCount++;
     if (_entryCount > 65534 && _zip64 == Zip64Option.Default)
     {
         _exceptionPending = true;
         throw new InvalidOperationException("Too many entries. Consider setting ZipOutputStream.EnableZip64.");
     }
     _currentEntry.WriteHeader(_outputStream, finishing ? 99 : 0);
     _currentEntry.StoreRelativeOffset();
     if (!_currentEntry.IsDirectory)
     {
         _currentEntry.WriteSecurityMetadata(_outputStream);
         _currentEntry.PrepOutputStream(_outputStream, (!finishing) ? (-1) : 0, out _outputCounter, out _encryptor, out _deflater, out _entryOutputStream);
     }
     _needToWriteEntryHeader = false;
 }