Datasheet

API in Java
98
String hex = Integer.toHexString(0xFF & messageDigest[i]);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex);
}
return hexString.toString();
}
/**
* converts hex value string to normal strint for use with RouterOS API
* @param s - hex string to convert to
* @return - converted string.
*/
static public String hexStrToStr(String s) {
String ret = "";
for (int i = 0; i < s.length(); i += 2) {
ret += (char) Integer.parseInt(s.substring(i, i + 2), 16);
}
return ret;
}
}
ReadCommand.java
This reads returns of the API
package libAPI;
/*
* CommandRead.java
*
* Created on 19 June 2007, 10:29
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import java.io.*;
import java.util.concurrent.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author janisk
*/
public class ReadCommand implements Runnable {