title: Java: read from binary file, send bytes over socket
body: <p>This should be easy, but I can't get my head around it right now. I wanna send some bytes over a socket, like </p>
  
  <pre><code>Socket s = new Socket("localhost", TCP_SERVER_PORT);
  DataInputStream is = new DataInputStream(new BufferedInputStream(s.getInputStream()));
  
  DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));
  
  for (int j=0; j&lt;40; j++) {
    dos.writeByte(0);
  }
  </code></pre>
  
  <p>That works, but now I dont want to  writeByte to the Outputstream, but read from a binary file, then write it out. I know(?) I need a FileInputStream to read from, I just can't figure out hot to construct the whole thing. </p>
  
  <p>Can someone help me out?</p>