title: copying a file from assets folder to /sdcard and randomize lines in it
body: <p>I have a text file to load from assets folder of an android app to "/sdcard/appname/"    but i want the lines to be randomize and save while copied to sdcard, here is the code that i write to copy but i struck at the part of how to randomize</p>
  
  <pre><code>    data_path="/sdcard/&lt;appname&gt;/"
      AssetManager assetManager = getAssets();
              InputStream in = assetManager.open("file.txt");
              OutputStream out = new FileOutputStream(data_path + "file.txt");
  
              // Transfer bytes from in to out
              byte[] buf = new byte[1024];
              int len;
              //while ((lenf = gin.read(buff)) &gt; 0) {
              while ((len = in.read(buf)) &gt; 0) {
                  out.write(buf, 0, len);
              }
              in.close();
              //gin.close();
              out.close();
  </code></pre>
  
  <p>How can i randomize the lines while copying (i'm not a java guy started working on it recently so this is kind of a noob question)</p>