예제 #1
0
        /// <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));
        }
예제 #2
0
 /// <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));
 }
예제 #3
0
 public IonWriter(TextWriter tw, WriterOptions options)
 {
     this.options = options;
     this.tw      = tw ?? throw new ArgumentNullException(nameof(tw));
 }