buffer = new char[50]; using (var reader = new StreamReader("file1.txt")) { reader.Read(buffer, 0, buffer.Length); } var buffer = new char[50]; var reader = new StreamReader("file1.txt"); reader.Read(buffer, 0, buffer.Length); reader.Dispose(); OR https://docs.microsoft.com/ja-jp/dotnet/standard/garbage-collection/using-objects より引用