Lines Matching refs:arr
96 byte[] arr = SnmpTools.ascii2binary(str);
97 validateId(arr);
100 static void validateId(byte[] arr) throws IllegalArgumentException {
102 if(arr.length < 5) throw new IllegalArgumentException("Id size lower than 5 bytes.");
103 if(arr.length > 32) throw new IllegalArgumentException("Id size greater than 32 bytes.");
106 if( ((arr[0] & 0x80) == 0) && arr.length != 12)
109 byte[] zeroedArrays = new byte[arr.length];
110 if(Arrays.equals(zeroedArrays, arr)) throw new IllegalArgumentException("Zeroed Id.");
111 byte[] FFArrays = new byte[arr.length];
113 if(Arrays.equals(FFArrays, arr)) throw new IllegalArgumentException("0xFF Id.");
119 * @return The created engine Id or null if given arr is null or its length == 0;
129 public static SnmpEngineId createEngineId(byte[] arr) throws IllegalArgumentException {
130 if( (arr == null) || arr.length == 0) return null;
131 validateId(arr);
132 return new SnmpEngineId(arr);