I have a hash table and I want to send it through by Datagram Socket. So to do this I need to have a byte array. How can I convert my hash table to a byte array? I've ignore filling a hash table I've tried do this by this way:
Hashtable<String, String> valueNick = new Hashtable<>();
nickStr = valueNick.toString();
byte[] bufferNick = nickStr.getBytes();
for (int i = 0; i < bufferNick.length; i++) {
System.out.print(bufferNick[i] + " ");
}
But nothing has been printed. Thanks very much for any help or advise.