@Test public void testException() { try { StringUtils.getBytesFromArraysToString((String) null); fail(ResourcesPublicUtilTest.EXPECTING_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION); } catch (final IllegalArgumentException e) { } try { StringUtils.getBytesFromArraysToString(""); fail(ResourcesPublicUtilTest.EXPECTING_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION); } catch (final IllegalArgumentException e) { } try { StringUtils.getBytesFromArraysToString("[ 7, a6 ]"); fail(ResourcesPublicUtilTest.EXPECTING_EXCEPTION_ILLEGAL_ARGUMENT_EXCEPTION); } catch (final IllegalArgumentException e) { } }
public static final byte[] getBytesFromArraysToString(final String bytesString) { ParametersChecker.checkParameter("Should not be null or empty", bytesString); final String[] strings = bytesString.replace("[", "").replace("]", "").split(", "); final byte[] result = new byte[strings.length]; try { for (int i = 0; i < result.length; i++) { result[i] = (byte) (Integer.parseInt(strings[i]) & 0xFF); } } catch (final NumberFormatException e) { throw new IllegalArgumentException(e); } return result; }
StringUtils { public static final byte[] getBytesFromArraysToString(final String bytesString) { ParametersChecker.checkParameter("Should not be null or empty", bytesString); final String[] strings = bytesString.replace("[", "").replace("]", "").split(", "); final byte[] result = new byte[strings.length]; try { for (int i = 0; i < result.length; i++) { result[i] = (byte) (Integer.parseInt(strings[i]) & 0xFF); } } catch (final NumberFormatException e) { throw new IllegalArgumentException(e); } return result; } }
StringUtils { public static final byte[] getBytesFromArraysToString(final String bytesString) { ParametersChecker.checkParameter("Should not be null or empty", bytesString); final String[] strings = bytesString.replace("[", "").replace("]", "").split(", "); final byte[] result = new byte[strings.length]; try { for (int i = 0; i < result.length; i++) { result[i] = (byte) (Integer.parseInt(strings[i]) & 0xFF); } } catch (final NumberFormatException e) { throw new IllegalArgumentException(e); } return result; } private  StringUtils(); }
StringUtils { public static final byte[] getBytesFromArraysToString(final String bytesString) { ParametersChecker.checkParameter("Should not be null or empty", bytesString); final String[] strings = bytesString.replace("[", "").replace("]", "").split(", "); final byte[] result = new byte[strings.length]; try { for (int i = 0; i < result.length; i++) { result[i] = (byte) (Integer.parseInt(strings[i]) & 0xFF); } } catch (final NumberFormatException e) { throw new IllegalArgumentException(e); } return result; } private  StringUtils(); static String checkSanityString(String value); static void checkSanityString(String ...strings); static final byte[] getRandom(final int length); static final byte[] getBytesFromArraysToString(final String bytesString); static final String getClassName(Object object); static final String substringBetween(String source, String start, String end); static final String substringBeforeLast(String source, String separator); static String getStringFromInputStream(InputStream is); }
StringUtils { public static final byte[] getBytesFromArraysToString(final String bytesString) { ParametersChecker.checkParameter("Should not be null or empty", bytesString); final String[] strings = bytesString.replace("[", "").replace("]", "").split(", "); final byte[] result = new byte[strings.length]; try { for (int i = 0; i < result.length; i++) { result[i] = (byte) (Integer.parseInt(strings[i]) & 0xFF); } } catch (final NumberFormatException e) { throw new IllegalArgumentException(e); } return result; } private  StringUtils(); static String checkSanityString(String value); static void checkSanityString(String ...strings); static final byte[] getRandom(final int length); static final byte[] getBytesFromArraysToString(final String bytesString); static final String getClassName(Object object); static final String substringBetween(String source, String start, String end); static final String substringBeforeLast(String source, String separator); static String getStringFromInputStream(InputStream is); static final Pattern HTML_PATTERN; static final Pattern UNPRINTABLE_PATTERN; static final List<String> RULES; }