Buffer classifier data

pull/194/head
M66B 4 years ago
parent 3806000149
commit 2b16b6d19f

@ -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()) {

Loading…
Cancel
Save