static void EndSubStream (Stream stream) { if (stream is TempFileStream) { ((TempFileStream) stream).RestorePosition (); } }