diff --git a/app/src/main/java/eu/faircode/email/MessageClassifier.java b/app/src/main/java/eu/faircode/email/MessageClassifier.java index 77b377039f..8935077f84 100644 --- a/app/src/main/java/eu/faircode/email/MessageClassifier.java +++ b/app/src/main/java/eu/faircode/email/MessageClassifier.java @@ -31,6 +31,8 @@ import androidx.preference.PreferenceManager; import org.jetbrains.annotations.NotNull; +import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; @@ -386,7 +388,7 @@ public class MessageClassifier { long start = new Date().getTime(); File file = getFile(context); - try (JsonWriter writer = new JsonWriter(new FileWriter(file))) { + try (JsonWriter writer = new JsonWriter(new BufferedWriter(new FileWriter(file)))) { writer.beginObject(); writer.name("version").value(2); @@ -467,7 +469,7 @@ public class MessageClassifier { long start = new Date().getTime(); File file = getFile(context); if (file.exists()) - try (JsonReader reader = new JsonReader(new FileReader(file))) { + try (JsonReader reader = new JsonReader(new BufferedReader(new FileReader(file)))) { reader.beginObject(); while (reader.hasNext()) switch (reader.nextName()) {