Get the same output of Netcat in Java
<p>I want to get the same output (in Java) that I get when I do this in the terminal (with Netcat):</p>

<pre><code>nc -l localhost 8080
</code></pre>

<p>The output I get is:</p>

<pre><code>GET /?code=Mdf81e469-fca0-f04e-db95-278aff0323be HTTP/1.1
Host: localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de
Connection: keep-alive
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4
</code></pre>

<p>I need this because of the output in the first line after the <code>GET</code>. I want to have it as a <code>String</code>value in Java.</p>