mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-29 17:11:12 +01:00
Jsoup parse from file to reduce memory usage
This commit is contained in:
@@ -23,6 +23,10 @@ import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class JsoupEx {
|
||||
static Document parse(String html) {
|
||||
|
||||
@@ -47,4 +51,8 @@ org.jsoup.UncheckedIOException: java.io.IOException: Input is binary and unsuppo
|
||||
return document;
|
||||
}
|
||||
}
|
||||
|
||||
static Document parse(File in) throws IOException {
|
||||
return Jsoup.parse(in, StandardCharsets.UTF_8.name());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user