title: Convert Byte array to file in chunks
body: <p>I know that there's a way of converting a file to byte array in chunks, here's a sample code:</p>
  
  <pre><code> InputStream inputStream = new FileInputStream(videoFile);
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       byte[] b = new byte[1024];
       int bytesRead =0;
       while ((bytesRead = inputStream.read(b)) != -1)
       {
         bos.write(b, 0, bytesRead);
       }
  </code></pre>
  
  <p>I'm looking for the opposite: a way of converting a byte array into a file in chunks. I didn't find any example of doing it in chunks.</p>