public void Dispose() { if (nested) { innerWriter.Dispose(); } else { Debug.Assert(generator.literalDataWritten); innerWriter.WritePacket(generator.signatureGenerator.Generate()); // DO NOT DISPOSE THE INNER WRITER } }