SteamWar/FightSystem
Archiviert
13
1

Optimize FileRecorder

Dieser Commit ist enthalten in:
yoyosource 2021-02-27 20:36:29 +01:00
Ursprung d2d7cb5730
Commit c8e796b2d6

Datei anzeigen

@ -22,10 +22,7 @@ package de.steamwar.fightsystem.record;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import java.io.DataOutputStream; import java.io.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPOutputStream;
@ -39,7 +36,7 @@ public class FileRecorder extends Recorder {
File file = new File(world.getWorldFolder(), world.getName() + ".recording"); File file = new File(world.getWorldFolder(), world.getName() + ".recording");
try{ try{
file.createNewFile(); 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){ }catch(IOException e){
throw new SecurityException("Could not open file", e); throw new SecurityException("Could not open file", e);
} }
@ -127,12 +124,12 @@ public class FileRecorder extends Recorder {
@Override @Override
protected void doFlush() { protected void doFlush() {
try { /*try {
outputStream.flush(); outputStream.flush();
} catch (IOException e) { } catch (IOException e) {
Bukkit.getLogger().log(Level.SEVERE, "Could not flush", e); Bukkit.getLogger().log(Level.SEVERE, "Could not flush", e);
close(); close();
} }*/
} }
@Override @Override