Internal Fixes, etc. (#20)

* Start removing mixed usages

* Check for directories before opening

* Fix writing

* Kinda fix rebuild

* One more try

* Better internal handling

* Slighty fix a couple more things

* Update RVWorld Compress code to db7d750bba

* Fix build

Co-authored-by: Matt Nadareski <mnadareski@mparticle.com>
This commit is contained in:
Matt Nadareski
2020-04-03 13:19:21 -07:00
committed by GitHub
parent 1de4bc7b18
commit 916d2a3b51
79 changed files with 3377 additions and 2337 deletions

View File

@@ -26,9 +26,9 @@ namespace Compress.SevenZip.Structure
ulong streamPosition = 0;
for (;;)
for (; ; )
{
HeaderProperty hp = (HeaderProperty) br.ReadByte();
HeaderProperty hp = (HeaderProperty)br.ReadByte();
switch (hp)
{
case HeaderProperty.kSize:
@@ -60,12 +60,12 @@ namespace Compress.SevenZip.Structure
public static void Write(BinaryWriter bw, ulong packPosition, PackedStreamInfo[] packedStreams)
{
ulong numPackStreams = (ulong) packedStreams.Length;
bw.Write((byte) HeaderProperty.kPackInfo);
ulong numPackStreams = (ulong)packedStreams.Length;
bw.Write((byte)HeaderProperty.kPackInfo);
bw.WriteEncodedUInt64(packPosition);
bw.WriteEncodedUInt64(numPackStreams);
bw.Write((byte) HeaderProperty.kSize);
bw.Write((byte)HeaderProperty.kSize);
ulong streamPosition = 0;
for (ulong i = 0; i < numPackStreams; i++)
{
@@ -77,14 +77,14 @@ namespace Compress.SevenZip.Structure
// Only checking the first CRC assuming all the reset will be the same
if (packedStreams[0].Crc != null)
{
bw.Write((byte) HeaderProperty.kCRC);
bw.Write((byte)HeaderProperty.kCRC);
for (ulong i = 0; i < numPackStreams; i++)
{
bw.WriteEncodedUInt64(packedStreams[i].Crc ?? 0);
}
}
bw.Write((byte) HeaderProperty.kEnd);
bw.Write((byte)HeaderProperty.kEnd);
}