Method
write
(char[] arr, OutputStream out)
Source from the content-addressed store, hash-verified
| 356 | } |
| 357 | |
| 358 | public static void write(char[] arr, OutputStream out) throws IOException { |
| 359 | int len = arr.length; |
| 360 | byte[] buf = new byte[len * 2]; |
| 361 | int idx = 0; |
| 362 | for (int i = 0; i < len; i++) { |
| 363 | buf[idx++] = (byte) (arr[i] & 0xff); |
| 364 | buf[idx++] = (byte) ((arr[i] >>> 8) & 0xff); |
| 365 | } |
| 366 | out.write(buf); |
| 367 | } |
| 368 | |
| 369 | public static void write(int[] arr, OutputStream out) throws IOException { |
| 370 | int len = arr.length; |
Tested by
no test coverage detected