public static String calcChallenge(String challenge1) {
char[] buffer = new char[128];
be32c(buffer, 0xa1e9149d, 0);
be32c(buffer, 0x0e6b3b59, 4);
if(challenge1 != null){
for (int i = 0; i < challenge1.length(); i++) {
char c = (char) (challenge1.charAt(i) ^ xorTable[i] & 0xffff);
buffer[8 + i] = c;
}
for (int i = challenge1.length(); i < xorTable.length; i++) {
buffer[8 + i] = xorTable[i];
}
}
String result = calcResponseString(buffer);
result = result + "01d0a8e3";
return result;
}
public static String calcCheckSum(String challenge2) {
StringBuffer buffer = new StringBuffer();
int len = challenge2.length() - 8;
for (int i = 0; i < len / 4; i++) {
buffer.append(challenge2.charAt(i * 4));
}
return buffer.toString();
}
public class Test {
private static int seq = 1 ;
private static final String CRLF = "\r\n";
private static final String URL = "rtsp://192.168.4.45:554/service?";
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Test t = new Test();
t.start();
}
private void start() throws IOException {
// TODO 自动生成方法存根
String mes = "";
Socket s = new Socket(InetAddress.getByName("124.42.50.52"), 554);
PrintWriter out = new PrintWriter(s.getOutputStream());
BufferedInputStream bis = new BufferedInputStream(s.getInputStream());
byte[] b = new byte[1024];
int t = 0, t1 = 0;
boolean f = true;
StringBuilder sb = new StringBuilder();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream("d:/tmp.rm"));
public class RSTPDownThread {
private static final String CRLF="\r\n";
/**
* @param args
* @throws InterruptedException
* @throws
* @throws IOException
*/
public static void main(String[] args) throws IOException, InterruptedException {
// TODO 自动生成方法存根
String mes;
Socket s = new Socket(InetAddress.getByName("58.211.7.218"),554);
PrintWriter out = new PrintWriter(s.getOutputStream());
BufferedInputStream bis = new BufferedInputStream(s.getInputStream());