Encoder for structured metadata.

This commit is contained in:
akwizgran
2016-01-05 10:38:43 +00:00
parent a419948147
commit d1611180fe
5 changed files with 194 additions and 6 deletions

View File

@@ -39,6 +39,14 @@ public class StringUtils {
}
}
public static String fromUtf8(byte[] bytes, int off, int len) {
try {
return new String(bytes, off, len, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
/** Converts the given byte array to a hex character array. */
public static char[] toHexChars(byte[] bytes) {
char[] hex = new char[bytes.length * 2];