code: public AudioInputStream getAudioInputStream(InputStream inputStream, int medialength, int totalms) throws UnsupportedAudioFileException, IOException {
          LOG.log(Level.FINE, "getAudioInputStream(InputStream inputStreamint medialength, int totalms)");
          try {
              if (!inputStream.markSupported()) {
                  inputStream = new BufferedInputStream(inputStream);
              }
              inputStream.mark(MARK_LIMIT);
              AudioFileFormat audioFileFormat = getAudioFileFormat(inputStream, medialength, totalms);
              inputStream.reset();
              return new AudioInputStream(inputStream, audioFileFormat.getFormat(), audioFileFormat.getFrameLength());
          } catch (UnsupportedAudioFileException | IOException e) {
              inputStream.reset();
              throw e;
          }
      }
docs: Return the AudioInputStream from the given InputStream.
  
  @param inputStream
  @param totalms
  @param medialength
  @return
  @throws javax.sound.sampled.UnsupportedAudioFileException
  @throws java.io.IOException