From c8e796b2d6dd4f222166309730fb70efd5368b24 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 27 Feb 2021 20:36:29 +0100 Subject: [PATCH] Optimize FileRecorder --- .../de/steamwar/fightsystem/record/FileRecorder.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/record/FileRecorder.java b/FightSystem_Main/src/de/steamwar/fightsystem/record/FileRecorder.java index 3a0c616..ff64aee 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/record/FileRecorder.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/record/FileRecorder.java @@ -22,10 +22,7 @@ package de.steamwar.fightsystem.record; import org.bukkit.Bukkit; import org.bukkit.World; -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; import java.util.logging.Level; import java.util.zip.GZIPOutputStream; @@ -39,7 +36,7 @@ public class FileRecorder extends Recorder { File file = new File(world.getWorldFolder(), world.getName() + ".recording"); try{ file.createNewFile(); - outputStream = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(file), 4096)); + outputStream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file)), 4096)); }catch(IOException e){ throw new SecurityException("Could not open file", e); } @@ -127,12 +124,12 @@ public class FileRecorder extends Recorder { @Override protected void doFlush() { - try { + /*try { outputStream.flush(); } catch (IOException e) { Bukkit.getLogger().log(Level.SEVERE, "Could not flush", e); close(); - } + }*/ } @Override