public StreamWriterEx(Stream stream, StreamWriterEx prev) : base(stream) { if (prev != null) { if (prev.next != null) { throw new Exception("Prev already in chain"); } prev.next = this; } this.prev = prev; }
public new void Dispose() { if (prev != null) { Flush(); BaseStream.Flush(); BaseStream.Position = 0; prev.Flush(); prev.BaseStream.Flush(); BaseStream.CopyTo(prev.BaseStream); prev.next = null; prev = null; } if (next != null) { next.prev = null; next = null; } base.Dispose(); }
public StreamWriterEx(Stream stream, StreamWriterEx prev) : base(stream) { prev.next = this; this.prev = prev; }