diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 54e84cd..6c2156f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,10 +9,10 @@
-
+
-
-
+
+
@@ -160,7 +160,15 @@
1723527352761
-
+
+
+ 1728336100523
+
+
+
+ 1728336100523
+
+
@@ -173,6 +181,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/net/screwgravity/vitality4j/standalone.java b/src/net/screwgravity/vitality4j/standalone.java
index 8e475e0..f50c340 100644
--- a/src/net/screwgravity/vitality4j/standalone.java
+++ b/src/net/screwgravity/vitality4j/standalone.java
@@ -165,6 +165,9 @@ public class standalone {
try {
PSARC psarc = new PSARC(new File (targetPath)); // System.getProperty("user.dir") + File.separator +
System.out.println("PSARC version " + psarc.version[0] + "." + psarc.version[1] + "." + psarc.version[2] + "." + psarc.version[3]);
+ String comp = "nothing";
+ if (psarc.algorithm == CompressionFormats.ZLIB) {comp = "ZLIB";} else if (psarc.algorithm == CompressionFormats.LZMA) {comp = "LZMA";}
+ System.out.println("Compressed with " + comp);
System.exit(0);
} catch (Exception e) {
System.out.println("Error reading file \"" + targetPath + "\".\n" + e.getMessage());
diff --git a/src/net/screwgravity/vitality4j/tools.java b/src/net/screwgravity/vitality4j/tools.java
index 634322a..797f382 100644
--- a/src/net/screwgravity/vitality4j/tools.java
+++ b/src/net/screwgravity/vitality4j/tools.java
@@ -73,6 +73,7 @@ public class tools {
public PathModes mode = PathModes.RELATIVE;
private RandomAccessFile fromDisk = null; // if NULL then file is a new file
private List files = new ArrayList();
+ private int toc_length = 0;
public PSARC() { // new w/ defaults
// use defaults, do nothing
@@ -93,6 +94,18 @@ public class tools {
// ok, it is safe to continue
fromDisk.seek(4);
fromDisk.read(version);
+
+ byte[] algorithm_cast = new byte[]{0, 0, 0, 0};
+ byte[] header_zlib = new byte[]{122, 108, 105, 98};
+ byte[] header_lzma = new byte[]{108, 122, 109, 97};
+ fromDisk.read(algorithm_cast);
+ if (Arrays.equals(algorithm_cast, header_zlib)) {algorithm = CompressionFormats.ZLIB;}
+ else if (Arrays.equals(algorithm_cast, header_lzma)) {algorithm = CompressionFormats.LZMA;}
+ else {throw new IncorrectFileTypeException("Unrecognized or unimplemented compression algorithm.");}
+
+ byte[] toc_length_cast = new byte[]{0, 0, 0, 0};
+ fromDisk.read(toc_length_cast);
+ //toc_length = (int)toc_length_cast;
}
public PSARC(CompressionFormats algorithm, byte strength) { // new