public override void Write(byte[] buffer, int offset, int count)
{
//we can't pass the argument checking down a level
if (buffer == null)
throw new ArgumentNullException(nameof(buffer));
if (offset < 0)
throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentNeedNonNegative);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentNeedNonNegative);
if ((buffer.Length - offset) < count)
throw new ArgumentException(SR.OffsetLengthInvalid);
Contract.EndContractBlock();
ThrowIfDisposed();
Debug.Assert(CanWrite);
//if we're not actually writing anything, we don't want to trigger the header
if (count == 0)
return;
if (!_everWritten)
{
_everWritten = true;
//write local header, we are good to go
_usedZip64inLH = _entry.WriteLocalFileHeader(false);
}
_crcSizeStream.Write(buffer, offset, count);
_position += count;
}