Don't jarjar anymore.

This commit is contained in:
zontreck 2024-10-09 22:21:30 -07:00
parent 44eb9d1d9c
commit 307b3427e8
77 changed files with 6359 additions and 15 deletions

View file

@ -0,0 +1,34 @@
package dev.zontreck.ariaslib.file;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
public class AriaIO {
public static void write(Path fileName, Entry folder) {
try {
DataOutputStream dos = new DataOutputStream(new FileOutputStream(fileName.toFile()));
folder.write(dos);
dos.close();
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static Entry read(Path fileName) {
try {
DataInputStream dis = new DataInputStream(new FileInputStream(fileName.toFile()));
return Entry.read(dis);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static Path resolveDataFile(String main) {
return Paths.get(main + ".aria");
}
}