Don't jarjar anymore.
This commit is contained in:
parent
44eb9d1d9c
commit
307b3427e8
77 changed files with 6359 additions and 15 deletions
34
src/main/java/dev/zontreck/ariaslib/file/AriaIO.java
Normal file
34
src/main/java/dev/zontreck/ariaslib/file/AriaIO.java
Normal 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");
|
||||
}
|
||||
}
|
Reference in a new issue