Commit 3c69d217c6e38cb90c93f005ed820b20c7672732

  • avatar
  • Bryan Kearney <bkearney @red…at.com>
  • Thu Jul 08 18:24:42 CEST 2010
Arrays.copyOf is a 1.6 feature. Need to ensure this builds against 1.5
  
4747 public static virSchedParameter toNative(SchedParameter param) {
4848 virSchedParameter returnValue = new virSchedParameter();
4949 returnValue.value = new virSchedParameterValue();
50 returnValue.field = Arrays.copyOf(param.field.getBytes(), Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH);
50 returnValue.field = copyOf(param.field.getBytes(), Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH);
5151 returnValue.type = param.getType();
5252 switch (param.getType()) {
5353 case (1):
7171
7272 }
7373 return returnValue;
74 }
75
76 public static byte[] copyOf(byte[] original, int length) {
77 byte[] returnValue = new byte[length];
78 int originalLength = original.length ;
79 Arrays.fill(returnValue, (byte)0);
80 for (int x = 0 ; x < originalLength ; x++) {
81 returnValue[x] = original[x] ;
82 }
83 return returnValue ;
7484 }
7585
7686 /**