1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-11 07:23:28 +08:00

Work in progress

This commit is contained in:
2022-11-04 22:10:55 +08:00
parent 8f5f9b09e4
commit f4457c5fd2
14 changed files with 321 additions and 61 deletions

View File

@@ -99,12 +99,12 @@ class LZ4DecompressionStream : Stream
if (buffSize <= 0) return readlen;
var rt = LZ4API.DecompressUpdateEx(dctx, dcmpBuffer, 0, dcmpBuffer.Capacity, srcBuffer, srcBuffer.Position,buffSize, null);
if (rt.expect < 0) throw new Exception(rt.expect.ToString());
if (rt.expect == 0) decompressFinish = true;
if (rt.Expect < 0) throw new Exception(rt.Expect.ToString());
if (rt.Expect == 0) decompressFinish = true;
srcBuffer.Position += (int)rt.readLen;
srcBuffer.Position += (int)rt.ReadLen;
dcmpBuffer.Position = 0;
dcmpBuffer.Length = (int)rt.writeLen;
dcmpBuffer.Length = (int)rt.WriteLen;
}
readPos += readlen;
return readlen;
@@ -118,12 +118,12 @@ class LZ4DecompressionStream : Stream
if (buffSize <= 0) return -1;
var rt = LZ4API.DecompressUpdateEx(dctx, dcmpBuffer, 0, dcmpBuffer.Capacity, srcBuffer, srcBuffer.Position, buffSize, null);
if (rt.expect < 0) throw new Exception(rt.expect.ToString());
if (rt.expect == 0) decompressFinish = true;
if (rt.Expect < 0) throw new Exception(rt.Expect.ToString());
if (rt.Expect == 0) decompressFinish = true;
srcBuffer.Position += (int)rt.readLen;
srcBuffer.Position += (int)rt.ReadLen;
dcmpBuffer.Position = 0;
dcmpBuffer.Length = (int)rt.writeLen;
dcmpBuffer.Length = (int)rt.WriteLen;
}
return dcmpBuffer.Buffer[dcmpBuffer.Position];
}