mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] General reformat and clean-up.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Aaru.Helpers.IO;
|
||||
|
||||
namespace Aaru.Compression;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user