1
0
mirror of https://github.com/soarqin/DSP_Mods_TO.git synced 2026-02-04 14:12:18 +08:00

format code

This commit is contained in:
2026-01-28 20:27:15 +08:00
parent d698e0afc1
commit 98abc31c6f
38 changed files with 2043 additions and 2043 deletions

View File

@@ -19,7 +19,7 @@ class BlackHoleStream : Stream
public override void Flush()
{
}
public override int Read(byte[] buffer, int offset, int count)

View File

@@ -46,7 +46,7 @@ public unsafe class BufferWriter : BinaryWriter
}
private BufferWriter(DoubleBuffer buffer , UTF8Encoding encoding, CompressionStream outStream) : base(Stream.Null, encoding)
private BufferWriter(DoubleBuffer buffer, UTF8Encoding encoding, CompressionStream outStream) : base(Stream.Null, encoding)
{
_baseStream = outStream;
_swapedBytes = 0;

View File

@@ -76,7 +76,7 @@ public class CompressionStream : Stream
}
return new CompressBuffer();
}
public BufferWriter BufferWriter { get; private set; }
public CompressionStream(WrapperDefines wrap, int compressionLevel, Stream outputStream, CompressBuffer compressBuffer, bool multiThread)
@@ -98,13 +98,13 @@ public class CompressionStream : Stream
{
_doubleBuffer = new DoubleBuffer(readBuffer ?? new byte[4 * Mb], writeBuffer ?? new byte[4 * Mb], Compress);
_outBuffer = outputBuffer ?? new byte[_wrapper.CompressBufferBound(writeBuffer?.Length ?? 4 * Mb)];
BufferWriter = new BufferWriter(_doubleBuffer,this);
BufferWriter = new BufferWriter(_doubleBuffer, this);
}
public override void Flush()
{
_doubleBuffer.SwapBuffer();
if(_useMultiThread)
if (_useMultiThread)
{
_doubleBuffer.WaitReadEnd();
}
@@ -151,7 +151,7 @@ public class CompressionStream : Stream
private void CompressAsync()
{
while(!_stopWorker)
while (!_stopWorker)
{
Compress_Internal();
}

View File

@@ -2,7 +2,7 @@ using System;
namespace CompressSave.Wrapper;
public class LZ4API: WrapperDefines
public class LZ4API : WrapperDefines
{
public static readonly bool Avaliable;
public static readonly LZ4API Instance = new();

View File

@@ -2,7 +2,7 @@
namespace CompressSave.Wrapper;
public class NoneAPI: WrapperDefines
public class NoneAPI : WrapperDefines
{
public static readonly bool Avaliable;
public static readonly NoneAPI Instance = new();

View File

@@ -5,7 +5,7 @@ namespace CompressSave.Wrapper;
internal class PeekableReader(DecompressionStream input) : BinaryReader(input)
{
public override int PeekChar()
{
{
return input.PeekByte();
}
}

View File

@@ -8,10 +8,10 @@ public static class WinApi
// LoadLibrary, GetProcAddress, FreeLibrary
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool FreeLibrary(IntPtr hModule);

View File

@@ -25,7 +25,7 @@ public class WrapperDefines
long srcSize);
protected unsafe delegate long DecompressUpdateFunc(IntPtr dctx, byte* dstBuffer, ref long dstCapacity, byte* srcBuffer,
ref long srcSize);
public CompressBufferBoundFunc CompressBufferBound;
public CompressBeginFunc CompressBegin;
public CompressEndFunc CompressEnd;

View File

@@ -2,7 +2,7 @@ using System;
namespace CompressSave.Wrapper;
public class ZstdAPI: WrapperDefines
public class ZstdAPI : WrapperDefines
{
public static readonly bool Avaliable;
public static readonly ZstdAPI Instance = new();