public override void Write(byte[] buffer, int offset, int count)
{
if (curEntry == null) {
throw new InvalidOperationException("No open entry.");
}
if (buffer == null) {
throw new ArgumentNullException(nameof(buffer));
}
if (offset < 0) {
throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative");
}
if (count < 0) {
throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative");
}
if ((buffer.Length - offset) < count) {
throw new ArgumentException("Invalid offset/count combination");
}
crc.Update(buffer, offset, count);
size += count;
switch (curMethod) {
case CompressionMethod.Deflated:
base.Write(buffer, offset, count);
break;
case CompressionMethod.Stored:
if (Password != null) {
CopyAndEncrypt(buffer, offset, count);
} else {
baseOutputStream_.Write(buffer, offset, count);
}
break;
}
}