Skip to content

Commit

Permalink
Increase zip processing cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Jun 26, 2021
1 parent fbefe02 commit 934ca77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Util.java
Expand Up @@ -304,7 +304,7 @@ private static List<String> zipsearch(File origin, File file) {

public static void zip(File file, OutputStream zip) {
File dir = (file.isFile())?file.getParentFile():file;
byte[] buffer = new byte[1024];
byte[] buffer = new byte[4096];

try{
ZipOutputStream zos = new ZipOutputStream(zip);
Expand Down Expand Up @@ -332,7 +332,7 @@ public static void zip(File file, OutputStream zip) {
}

public static void unzip(InputStream zip, File dir) {
byte[] buffer = new byte[1024];
byte[] buffer = new byte[4096];
try{
ZipInputStream zis = new ZipInputStream(zip);
ZipEntry ze;
Expand Down
10 changes: 0 additions & 10 deletions GalaxiAPI/src/net/ME1312/Galaxi/Log/LogTranslator.java
Expand Up @@ -54,16 +54,6 @@ public void publish(LogRecord record) {
}
}

private String convert(Object obj) {
if (obj instanceof Throwable) {
StringWriter sw = new StringWriter();
((Throwable) obj).printStackTrace(new PrintWriter(sw));
return sw.toString();
} else {
return Util.getDespiteException(() -> (obj == null)?"null":obj.toString(), "err");
}
}

@Override
public void flush() {
// do nothing
Expand Down
Expand Up @@ -774,7 +774,7 @@ private void loadContent() {
}

int i;
byte[] b = new byte[1024];
byte[] b = new byte[4096];
ByteArrayOutputStream stream = new ByteArrayOutputStream();
while ((i = reader.read(b)) != -1) {
stream.write(b, 0, i);
Expand Down

0 comments on commit 934ca77

Please sign in to comment.