I'm getting weird results from Apache Commons Lang's StringUtils.join. Let's say I have:
List<String> values = new LinkedList<>();
values.add("120");
values.add("123456789");
values.add("9000");
values.add("en");
byte[] data = StringUtils.join(values, new char[] {1}).getBytes();
I expected to have 31323001313233343536373839013930303001656e, which is 120.123456789.9000.en, with . as 0x01. But what confuses me is that I'm getting
5b3132302c203132333435363738392c20393030302c20656e5d5b4340333664303437 instead, which converts to [120, 123456789, 9000, en][C@36d047. Is there a gotcha in the way I'm doing this that's causing the weird value?
joinmethod are you using? I'm not getting anyjoinmethod which takes 2nd argument aschararray.