mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-12 03:16:29 +03:00
remove console.writeline's in OuterEncryptionReader
This commit is contained in:
@@ -113,7 +113,6 @@ public class OuterEncryptionReader : Stream
|
|||||||
|
|
||||||
public override int Read(Span<byte> buffer)
|
public override int Read(Span<byte> buffer)
|
||||||
{
|
{
|
||||||
Console.WriteLine("OE read " + buffer.Length);
|
|
||||||
int toRead = buffer.Length;
|
int toRead = buffer.Length;
|
||||||
int read = 0;
|
int read = 0;
|
||||||
while (toRead > 0)
|
while (toRead > 0)
|
||||||
@@ -122,24 +121,20 @@ public class OuterEncryptionReader : Stream
|
|||||||
{
|
{
|
||||||
if (!isCurrentChunkLast)
|
if (!isCurrentChunkLast)
|
||||||
{
|
{
|
||||||
Console.WriteLine("OER: reading next chunk");
|
|
||||||
LoadAndDecryptNextChunk();
|
LoadAndDecryptNextChunk();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("OER: read " + read + " bytes before EOF");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
byte[] chunk = currentChunk!;
|
byte[] chunk = currentChunk!;
|
||||||
int n = Math.Min(toRead, chunk.Length - chunkPosition);
|
int n = Math.Min(toRead, chunk.Length - chunkPosition);
|
||||||
Console.WriteLine("OER: copy " + n + " bytes chunk+" + chunkPosition + " -> buffer+" + read);
|
|
||||||
new Span<byte>(chunk, chunkPosition, n).CopyTo(buffer.Slice(read));
|
new Span<byte>(chunk, chunkPosition, n).CopyTo(buffer.Slice(read));
|
||||||
read += n;
|
read += n;
|
||||||
toRead -= n;
|
toRead -= n;
|
||||||
chunkPosition += n;
|
chunkPosition += n;
|
||||||
position += n;
|
position += n;
|
||||||
Console.WriteLine(string.Format("read={0} toread={1} pos={2}", read, toRead, chunkPosition));
|
|
||||||
}
|
}
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user