(CharArr out)
| 271 | byte[] arr = new byte[out.size() * 3]; |
| 272 | int nBytes = ByteUtils.UTF16toUTF8(out, 0, out.size(), arr, 0); |
| 273 | return Arrays.copyOf(arr, nBytes); |
| 274 | } |
| 275 | |
| 276 | public static Object fromJSON(byte[] utf8) { |
| 277 | // Need below check in both fromJSON methods since |
| 278 | // utf8.length returns a NPE without this check. |
| 279 | if (utf8 == null || utf8.length == 0) { |
| 280 | return Map.of(); |