title: Why is FileInputStream closing
body: <p>I am trying to read a video file from local storgae by chunks and upload to a server. I have this code working in another java platform so i thought it would be quite simple.</p>
  
  <p>When i try to open the File using </p>
  
  <pre><code> File f = new File(filePath);
   fileIn = new FileInputStream(f);
  </code></pre>
  
  <p>it opens and i can read whatever i need from the file, further down in my code though i call </p>
  
  <pre><code>    SocketFactory socketFactory = SSLSocketFactory.getDefault();
      Socket socket = socketFactory.createSocket(url, 443);
  
      _in = new InputStreamReader(socket.getInputStream());
      _out = (OutputStream)socket.getOutputStream();
  </code></pre>
  
  <p>The socket connects fine but when I then come to read the FileInputStream after this bit of code I get stream closed exception.</p>
  
  <p>Any ideas? I don't see anything in the log to show anything is failing but i can't read from the fileinputstream once i have conencted to the server??</p>
  
  <p>Let me know if you need to know anything else to help.</p>