com.plato.util.html.PlayGround Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of HTMLSearchableCompression Show documentation
Show all versions of HTMLSearchableCompression Show documentation
A utility library for compressing HTML while being able to search text.
The newest version!
package com.plato.util.html;
public class PlayGround {
public static void main(String[] args) {
runTest();
}
private static void runTest() {
String init = "abc
";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1; i++) {
sb.append(init);
}
String in = sb.toString();
HTMLSearchableCompression parser = new HTMLSearchableCompression();
parser.encode(in);
String tags = parser.serializeTagsString();
String plain = parser.getPlainText();
HTMLSearchableCompression parser2 = HTMLSearchableCompression.deserializeString(tags);
System.out.println(HTMLSearchableCompression.decode(plain, parser2.getTags(), parser2.getSelfClosings()));
}
}