/// <summary> /// Creates the instance of <see cref="IIonWriter"/> from specified stream. /// </summary> /// <param name="stream"><see cref="Stream"/> to write to.</param> public static IIonWriter Create(Stream stream, WriterOptions options) { var writer = new StreamWriter(stream); return(Create(writer, options)); }
/// <summary> /// Creates the instance of <see cref="IIonWriter"/> from specified <see cref="TextWriter"/>. /// </summary> /// <param name="tw"><see cref="TextWriter"/> used to write.</param> /// <param name="options">Writing options.</param> public static IIonWriter Create(TextWriter tw, WriterOptions options) { return(new IonWriter(tw, options)); }
public IonWriter(TextWriter tw, WriterOptions options) { this.options = options; this.tw = tw ?? throw new ArgumentNullException(nameof(tw)); }