[Refactor] General reformat and clean-up.

This commit is contained in:
2025-11-24 20:12:10 +00:00
parent 8331fba1e4
commit a58f2e60e5
415 changed files with 4920 additions and 4829 deletions

View File

@@ -18,12 +18,12 @@ public partial class CrunchStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
int err = rle switch
{
@@ -83,7 +83,7 @@ public partial class CrunchStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class LzwStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
int err;
@@ -77,7 +77,7 @@ public partial class LzwStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class PackStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err = arc_decompress_pack(inBuf, inBuf.Length, _decoded, ref outLen);
@@ -69,7 +69,7 @@ public partial class PackStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class SqueezeStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err = arc_decompress_squeeze(inBuf, inBuf.Length, _decoded, ref outLen);
@@ -69,7 +69,7 @@ public partial class SqueezeStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -27,9 +27,7 @@
// ****************************************************************************/
using System;
using System.IO;
using System.Runtime.InteropServices;
using Aaru.Helpers.IO;
namespace Aaru.Compression;

View File

@@ -28,12 +28,12 @@ public partial class HaStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err;
@@ -96,7 +96,7 @@ public partial class HaStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class Lh5Stream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err = lh5_decompress(inBuf, inBuf.Length, _decoded, ref outLen);
@@ -69,7 +69,7 @@ public partial class Lh5Stream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class CrushStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err = pak_decompress_crush(inBuf, inBuf.Length, _decoded, ref outLen);
@@ -69,7 +69,7 @@ public partial class CrushStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;

View File

@@ -18,12 +18,12 @@ public partial class DistillStream : Stream
// Read full compressed data into memory
compressedStream.Position = 0;
byte[] inBuf = new byte[compressedStream.Length];
var inBuf = new byte[compressedStream.Length];
compressedStream.ReadExactly(inBuf, 0, inBuf.Length);
// Allocate output buffer
_decoded = new byte[decompressedLength];
nint outLen = (nint)decompressedLength;
var outLen = (nint)decompressedLength;
// Call native decompressor
int err = pak_decompress_distill(inBuf, inBuf.Length, _decoded, ref outLen);
@@ -69,7 +69,7 @@ public partial class DistillStream : Stream
if(remaining <= 0) return 0;
int toRead = (int)Math.Min(count, remaining);
var toRead = (int)Math.Min(count, remaining);
Array.Copy(_decoded, _position, buffer, offset, toRead);
_position += toRead;