title: How to Decrypt Video File chuck by chunk and pass to video view?
body: <p>Here is my code to decrypt the whole video file and pass decrypted video file path to video view so how to decrypt video chunk by chunk and pass it to video view and after first chunk pass after that second chunk will be decrypted in background and after that second chunk decrypted pass it to video view how can achieve that</p>
  
  <pre><code>try
  {
  
      FileInputStream encfis = new FileInputStream(Encrypted_File_Path);
      FileOutputStream decfos = new FileOutputStream(Decrypted_File_Path);
  
      Cipher decipher = Cipher.getInstance("AES");
  
      String encode ="8888888888888888";
      byte[] decodedKey = encode.getBytes();
      SecretKey originalKey = new SecretKeySpec(decodedKey, 0, decodedKey.length, "AES");
  
      decipher.init(Cipher.DECRYPT_MODE, originalKey);
      CipherOutputStream cos = new CipherOutputStream(decfos,decipher);
  
      int c;
      byte[] d1 = new byte[4096 * 2048];
      while((c = encfis.read(d1)) != -1)
      {
          cos.write(d1, 0, c);
          cos.flush();
      }
      cos.close();
  }
  catch(Exception e)
  {
      e.printStackTrace();
  }
  </code></pre>