How to forward data read from a socket by prepending an IP and UDP or TCP header?
<p>I want to forward data read from a socket. The consumer is not a socket. It expects an IP packet. Hence I have to write an IPv4 or IPv6 header. I also need to add a UDP or TCP header.
<br>What is the best way to do this? 
<br>I know there are big libraries (such as Jpcap?) to do this and more.
<br>Any recommendations as to where I can find a <i>small</i> piece of java code?</p>
