Added DNS response TC

This commit is contained in:
Ziver Koc 2016-04-19 14:33:29 +02:00
parent 31a47f52cd
commit ea206cc5b5
4 changed files with 90 additions and 19 deletions

View file

@ -65,6 +65,17 @@ public class Converter {
(byte)((num >> 16)& 0xff),
(byte)((num >> 24)& 0xff)};
}
/**
* Converts a char array to a byte array.
*
* @return a byte array with the same binary value as the char.
*/
public static byte[] toBytes(char[] arr){
byte[] ret = new byte[arr.length];
System.arraycopy(arr, 0, ret, 0, arr.length);
return ret;
}
/**
* Converts a Integer to a byte