title: Parsing pcap taken from wireshark file using - Java
body: <p>I am working on converting PCAP file taken from wireshark using JAVA without using native or ready libraries. </p>
  
  <p>i converted the bytes to string directly just for checking the meaningful parts of it.</p>
  
  <p>then i tried to convert it from hexadecimal to string. It was not meaningful.</p>
  
  <p>there is java library <a href="http://jnetpcap.com/">jNetPcap</a> which is wrapping all the libpcap library native calls which is written in c.</p>
  
  <p>The following picture is captured the wireless network. so the pcap contains the same information: Source ip, destination ip, protocol, length and info</p>
  
  <p><a href="https://i.stack.imgur.com/eWZRj.png"><img src="https://i.stack.imgur.com/eWZRj.png" alt="Wireshark picture"></a></p>
  
  <p>I am trying to get the same result form the <strong>pcap</strong> file which contains the data in hexadecimal or binary:</p>
  
  <pre><code>d4c3 b2a1 0200 0400 0000 0000 0000 0000
  0000 0400 0100 0000 2fd4 b355 2af8 0600
  3600 0000 3600 0000 0100 5e00 0016 f409
  d8ed d951 0800 46c0 0028 0000 4000 0102
  4049 c0a8 0308 e000 0016 9404 0000 2200
  fa02 0000 0001 0300 0000 e000 00fb 2fd4
  </code></pre>
  
  <p>at the end i want to get to the output to be like something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/aRPwx.png"><img src="https://i.stack.imgur.com/aRPwx.png" alt="Output"></a></p>
  
  <p>Any clue or suggestions where to get the packets and file format can help me alot. there maybe somebody else who already came along with this problem ?</p>
  
  <p><strong>Thank you</strong></p>