title: Convert hash table to byte array
body: <p>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:</p>
  
  <pre><code>    Hashtable&lt;String, String&gt; valueNick = new Hashtable&lt;&gt;();
      nickStr = valueNick.toString();
      byte[] bufferNick = nickStr.getBytes();
      for (int i = 0; i &lt; bufferNick.length; i++) {
               System.out.print(bufferNick[i] + " ");
          }
  </code></pre>
  
  <p>But nothing has been printed.
                  Thanks very much for any help or advise.</p>