How does the AudioInputStream.read(byte[] b) function work?
I have posted the questeion also here [https://stackoverflow.com/questions/52129685/how-does-the-audioinputstream-readbyte-b-function-work] I have a problem with this [ "https://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/AudioInputStream.html#read(byte[])" ] method. In the following i have written a test code that reads an audio stream into a byte array (and does a convertion [i have mp3plugin.jar as external jar, if you should wonder why this works] and some other stuff, but i have only let that in to make the code executable). The problem is that the method seams not allways to do the same thing. Sometimes the AudioInputStream is getting smaller and sometimes it is not. My question is why? I haven't enough space here to post the full code but it is the following method that - called multiple times - results in different outcomes. System.out.println("read " + converted.read(audioBytes)); System.out.println(converted.available()); The first time the javax.sound.sampled.AudioInputStream called "converted" gets smaller the second time it doesn't. To see the full code I recommend watching out my post on stackoverflow https://stackoverflow.com/questions/52129685/how-does-the-audioinputstream-readbyte-b-function-work or https://stackoverflow.com/q/52129685/6307611