Update 82_Stars with common library

This commit is contained in:
Andrew Cooper
2022-03-20 17:19:29 +11:00
parent d6ddc6bf9e
commit 4fb62ce30c
9 changed files with 147 additions and 134 deletions

View File

@@ -94,6 +94,13 @@ public interface IReadWrite
/// <param name="value">The <see cref="object" /> to be written.</param>
void WriteLine(object value);
/// <summary>
/// Writes a formatted string to output.
/// </summary>
/// <param name="format">The format <see cref="string" /> to be written.</param>
/// <param name="value">The values to be inserted into the format.</param>
void WriteLine(string format, params object[] values);
/// <summary>
/// Writes the contents of a <see cref="Stream" /> to output.
/// </summary>

View File

@@ -99,6 +99,8 @@ public class TextIO : IReadWrite
public void WriteLine(object value) => _output.WriteLine(value.ToString());
public void WriteLine(string format, params object[] values) => _output.WriteLine(format, values);
public void Write(Stream stream, bool keepOpen = false)
{
using var reader = new StreamReader(stream);