+ public static String toString(Class<?> clss, String resource) {
+ return toString(clss.getResourceAsStream(resource), StandardCharsets.UTF_8);
+ }
+
+ public static String toString(InputStream in) {
+ return toString(in, StandardCharsets.UTF_8);
+ }
+
+ public static String toString(InputStream in, Charset encoding) {
+ try {
+ return new String(in.readAllBytes(), encoding);
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ }
+