@@ -0,0 +1,727 @@
+package i5.las2peer.registryGateway;%0A%0Aimport java.nio.charset.StandardCharsets;%0A%0Apublic class Util %7B%0A%09private Util() %7B%0A%09%7D%0A%0A%09/**%0A%09 * Convert String to to byte array, padded with zero bytes.%0A%09 *%0A%09 * If the desired length is shorter than the input, arraycopy will%0A%09 * throw ArrayIndexOutOfBoundsException. (Maybe emit warning and%0A%09 * truncate instead?)%0A%09 */%0A%09public static byte%5B%5D padAndConvertString(String string, int desiredLength) %7B%0A%09%09byte%5B%5D output = new byte%5BdesiredLength%5D;%0A%09%09byte%5B%5D possiblyTooShort = string.getBytes(StandardCharsets.UTF_8);%0A%0A%09%09int inputLength = possiblyTooShort.length;%0A%09%09int offset = desiredLength - inputLength;%0A%09%09System.arraycopy(possiblyTooShort, 0, output, offset, inputLength);%0A%09%09return output;%0A%09%7D%0A%7D%0A

add utility class (string to byte[])