public override void Write(byte[] b, int off, int len)
{
if (aes) {
byte[] b2 = cipher.Update(b, off, len);
if (b2 == null || b2.Length == 0)
return;
outc.Write(b2, 0, b2.Length);
}
else {
byte[] b2 = new byte[Math.Min(len, 4192)];
while (len > 0) {
int sz = Math.Min(len, b2.Length);
arcfour.EncryptARCFOUR(b, off, sz, b2, 0);
outc.Write(b2, 0, sz);
len -= sz;
off += sz;
}
}
}