|
if (!_finalBlockTransformed) { |
Hallo,
please pay attention on this piece of code as it may leave the BaseStream open ... in case that the FlushFinalBlock operation will raise an exception.
Instead of
if (!_finalBlockTransformed)
{
FlushFinalBlock();
}
if (!_leaveOpen)
{
_stream.Close();
}
is it not better if we change it to:
try {
if (!_finalBlockTransformed)
{
FlushFinalBlock();
}
} finally {
if (!_leaveOpen)
{
_stream.Close();
}
}