title: Reading a resource sound file into a Byte array
body: <p>I have <code>cheerapp.wav</code> or <code>cheerapp.mp3</code> or some other format.</p>
  
  <pre><code>InputStream in = context.getResources().openRawResource(R.raw.cheerapp);       
  BufferedInputStream bis = new BufferedInputStream(in, 8000);
  // Create a DataInputStream to read the audio data from the saved file
  DataInputStream dis = new DataInputStream(bis);
  
  byte[] music = null;
  music = new byte[??];
  int i = 0; // Read the file into the "music" array
  while (dis.available() &gt; 0) {
      // dis.read(music[i]); // This assignment does not reverse the order
      music[i]=dis.readByte();
      i++;
  }
  
  dis.close();          
  </code></pre>
  
  <p>For the <code>music</code> byte array which takes the data from the <code>DataInputStream</code>. I don't know what the length of that to allocate.</p>
  
  <p>This is raw file from resource not a file therefore I wouldn't know the size of that thing.</p>