blob: 0d1b40bbe1dc0c3cf9a1f35916b8b433cf6f448c [file] [log] [blame]
package reactortest;
import java.nio.charset.Charset;
public class ByteArrayConverter {
public static String asString(byte[] ba) {
return new String(ba, Charset.forName("UTF-8"));
}
public static Integer asInteger(byte[] ba) {
return new Integer(asString(ba));
}
public static Double asDouble(byte[] ba) {
return new Double(asString(ba));
}
public static byte[] fromString(String in) {
return in.getBytes(Charset.forName("UTF-8"));
}
public static byte[] fromInteger(Integer in) {
return fromString(in.toString());
}
}