1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 03:33:29 +08:00

code cleanup

This commit is contained in:
2023-12-14 21:52:35 +08:00
parent aa5d8a2454
commit 51f35bb573
28 changed files with 318 additions and 466 deletions

View File

@@ -5,7 +5,7 @@ namespace CompressSave.Wrapper;
class BlackHoleStream : Stream
{
private long length;
private long _length;
public override bool CanRead => true;
@@ -13,18 +13,13 @@ class BlackHoleStream : Stream
public override bool CanWrite => true;
public override long Length => length;
public override long Length => _length;
public override long Position { get; set; }
public BlackHoleStream()
{
}
public override void Flush()
{
;
}
public override int Read(byte[] buffer, int offset, int count)
@@ -39,12 +34,13 @@ class BlackHoleStream : Stream
public override void SetLength(long value)
{
length = value;
_length = value;
}
public byte[] testBuffer = new byte[1024 * 1024];
private readonly byte[] _testBuffer = new byte[1024 * 1024];
public override void Write(byte[] buffer, int offset, int count)
{
Array.Copy(buffer, offset, testBuffer, 0, Math.Min(count, testBuffer.Length));
Array.Copy(buffer, offset, _testBuffer, 0, Math.Min(count, _testBuffer.Length));
}
}