Пример #1
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     if (_disposed)
     {
         _exceptionPending = true;
         throw new InvalidOperationException("The stream has been closed.");
     }
     if (buffer == null)
     {
         _exceptionPending = true;
         throw new ArgumentNullException("buffer");
     }
     if (_currentEntry == null)
     {
         _exceptionPending = true;
         throw new InvalidOperationException("You must call PutNextEntry() before calling Write().");
     }
     if (_currentEntry.IsDirectory)
     {
         _exceptionPending = true;
         throw new InvalidOperationException("You cannot Write() data for an entry that is a directory.");
     }
     if (_needToWriteEntryHeader)
     {
         _InitiateCurrentEntry(finishing: false);
     }
     if (count != 0)
     {
         _entryOutputStream.Write(buffer, offset, count);
     }
 }