Skip to content

Commit b680765

Browse files
committed
Add comment to clarify that StreamReader uses a buffer size of 1024 bytes.
1 parent 5408aac commit b680765

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Renci.SshNet/SftpClient.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
32
using System.Collections.Generic;
43
using System.Diagnostics.CodeAnalysis;
54
using System.IO;
@@ -1425,6 +1424,9 @@ public string[] ReadAllLines(string path)
14251424
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
14261425
public string[] ReadAllLines(string path, Encoding encoding)
14271426
{
1427+
// we use the default buffer size for StreamReader - which is 1024 bytes - and the configured buffer size
1428+
// for the SftpFileStream; may want to revisit this later
1429+
14281430
var lines = new List<string>();
14291431
using (var stream = new StreamReader(OpenRead(path), encoding))
14301432
{
@@ -1464,6 +1466,9 @@ public string ReadAllText(string path)
14641466
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
14651467
public string ReadAllText(string path, Encoding encoding)
14661468
{
1469+
// we use the default buffer size for StreamReader - which is 1024 bytes - and the configured buffer size
1470+
// for the SftpFileStream; may want to revisit this later
1471+
14671472
using (var stream = new StreamReader(OpenRead(path), encoding))
14681473
{
14691474
return stream.ReadToEnd();

0 commit comments

Comments
 (0)