25 lines
No EOL
605 B
C#
25 lines
No EOL
605 B
C#
// Copyright (c) The Geekeey Authors
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
internal sealed class Output : IDisposable
|
|
{
|
|
public StreamReader Stdin { get; } = new(Console.OpenStandardInput(), leaveOpen: false);
|
|
|
|
public StreamWriter Stdout { get; } = new(Console.OpenStandardOutput(), leaveOpen: false);
|
|
|
|
public StreamWriter Stderr { get; } = new(Console.OpenStandardError(), leaveOpen: false);
|
|
|
|
public static Output Connect()
|
|
{
|
|
return new Output();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Stdout.BaseStream.Flush();
|
|
Stdout.Dispose();
|
|
Stderr.BaseStream.Flush();
|
|
Stderr.Dispose();
|
|
Stdin.Dispose();
|
|
}
|
|
} |