Documentation for AudioSystem.getAudioInputStream(InputStream):
The implementation of this method may require multiple parsers to examine the stream to determine whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream's read pointer to its original position. If the input stream does not support this operation, this method may fail with an IOException.
So, the stream you are providing to this method should support mark/reset functionality.