static byte[] resizeByteArray(byte[] a, int n) { if (n == l(a)) ret a; byte[] b = new byte[n]; arraycopy(a, 0, b, 0, min(l(a), n)); ret b; }