Closed kaminskypavel closed 6 years ago
Update
I was able to make this work by fixing fixing bytesToMacStr
method in Mac.java
just copy paste the following code.
public static byte[] macStrToBytes(String macStr) throws MacFormatException {
if (macStr == null) {
throw new MacFormatException(macStr);
}
String[] macs = macStr.split(":");
if (macs.length != 6) {
throw new MacFormatException(macStr);
}
byte[] bout = new byte[6];
for (int i = 0; i < macs.length; i++) {
try {
_Integer hex = Integer.parseInt(macs[i], 16);
bout[i] = hex.byteValue();_
} catch (NumberFormatException e) {
throw new MacFormatException(macStr, e);
}
}
return bout;
}
@mob41 , mind merging?
Yea, thank you for reporting this. It is appreciated that you can modify it and push to this repository. Thanks!
sure there you go, #14.
maybe im missing something out, but it seems like
macStrToBytes(String macStr)
assumes that macStr contains numbers only, and following loop throws an exception