Commit 3c69d217c6e38cb90c93f005ed820b20c7672732
Arrays.copyOf is a 1.6 feature. Need to ensure this builds against 1.5
| |   |
| 47 | 47 | public static virSchedParameter toNative(SchedParameter param) { |
| 48 | 48 | virSchedParameter returnValue = new virSchedParameter(); |
| 49 | 49 | returnValue.value = new virSchedParameterValue(); |
| returnValue.field = Arrays.copyOf(param.field.getBytes(), Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH); |
| returnValue.field = copyOf(param.field.getBytes(), Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH); |
| 51 | 51 | returnValue.type = param.getType(); |
| 52 | 52 | switch (param.getType()) { |
| 53 | 53 | case (1): |
| … | … | |
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | return returnValue; |
| } |
| |
| public static byte[] copyOf(byte[] original, int length) { |
| byte[] returnValue = new byte[length]; |
| int originalLength = original.length ; |
| Arrays.fill(returnValue, (byte)0); |
| for (int x = 0 ; x < originalLength ; x++) { |
| returnValue[x] = original[x] ; |
| } |
| return returnValue ; |
| 74 | 84 | } |
| 75 | 85 | |
| 76 | 86 | /** |