unable to write the complete audiostream to an audio file in java
<p>I am trying to convert audio to audiostream and then back to audio using java. When i read the wav file into the byte array it shows around 30000 bytes but when i write it onto a new fle, it just writes 44 bytes.Please tell me where am i going wrong. The code snippet is as follows:</p>

<pre><code>    File src = new File("C:\\test.wav");
    AudioInputStream ais = AudioSystem.getAudioInputStream(src);  
    byte[] data = new byte[ais.available()];
    int x = ais.read(data);

    int n = AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("C:\\test2.wav"));
    System.out.println("x="+x+"  n="+n);
</code></pre>

<p>The output of n is 44.</p>
