/// <summary> /// Initializes a new instance of the <see cref="T:XmppStreamParser"/> class. /// </summary> /// <param name="stream">The stream.</param> public XmppStreamParser(XmppMemoryStream stream) { this.stream = stream; this.reader = new BinaryReader(this.stream, Encoding.UTF8); this.node = new StringBuilder(); this.currentTag = new StringBuilder(); }
/// <summary> /// Disposes the specified disposing. /// </summary> /// <param name="disposing">if set to <c>true</c> [disposing].</param> private void Dispose(bool disposing) { if (!this.isDisposed) { if (disposing) { // Release managed resources here this.depth = 0; this.currentTag = null; this.node = null; this.nodeName = null; if (this.reader != null) { this.reader.Close(); this.reader = null; } if (this.stream != null) { this.stream.Dispose(); this.stream = null; } } // Call the appropriate methods to clean up // unmanaged resources here. // If disposing is false, // only the following code is executed. } this.isDisposed = true; }