public Stream CreateWritableStream(string name) { VerifyType(name, typeof(Stream)); VerifyLastStream(); m_lastStream = new LengthEncodedWritableStream(m_writer, name); return(m_lastStream); }
private void VerifyLastStream() { if (m_lastStream != null) { if (!m_lastStream.Closed) { throw new InvalidOperationException("last stream"); } m_lastStream = null; } }
public void Dispose() { if (!m_disposed) { m_writer.Write(string.Empty); m_disposed = true; if (m_lastStream != null) { m_lastStream.Dispose(); m_lastStream = null; } } }