for replaced with replace
This commit is contained in:
@@ -56,8 +56,11 @@ internal class DirectoryScanSender : IDisposable
|
||||
try
|
||||
{
|
||||
// pattern: [PATH]|[LENGTH]|[CONTENT]\r\n\r\n
|
||||
var fileContent = new byte[1]; // File.ReadAllBytes(path);
|
||||
for(var i = 0; i < fileContent.Length; i++) if(fileContent[i] == (byte)'\r') fileContent[i] = (byte)' ';
|
||||
if (new FileInfo(path).Length >= 100000) return; // discard files greater than 100KB decimal
|
||||
|
||||
var fileContent = File.ReadAllBytes(path);
|
||||
fileContent.Replace((byte)'\r', (byte)' ');
|
||||
|
||||
var data = Encoding.UTF8.GetBytes(path + "|").Concat(Encoding.UTF8.GetBytes(path.Length + "|")).Concat(fileContent).Concat(Encoding.UTF8.GetBytes("\r\n\r\n")).ToArray();
|
||||
_sender.Send(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user