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