--- old/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java 2016-04-07 21:16:18.000000000 +0300 +++ new/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java 2016-04-07 21:16:18.000000000 +0300 @@ -34,7 +34,6 @@ import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.AudioInputStream; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; /** @@ -167,7 +166,7 @@ } @Override - AudioFileFormat getAudioFileFormatImpl(final InputStream stream) + StandardFileFormat getAudioFileFormatImpl(final InputStream stream) throws UnsupportedAudioFileException, IOException { RIFFReader riffiterator = new RIFFReader(stream); @@ -249,19 +248,17 @@ } else { throw new UnsupportedAudioFileException(); } - long frameLength = dataSize / audioformat.getFrameSize(); - if (frameLength > Integer.MAX_VALUE) { - frameLength = AudioSystem.NOT_SPECIFIED; - } - return new AudioFileFormat(AudioFileFormat.Type.WAVE, audioformat, - (int) frameLength); + return new StandardFileFormat(AudioFileFormat.Type.WAVE, audioformat, + dataSize / audioformat.getFrameSize()); } @Override public AudioInputStream getAudioInputStream(final InputStream stream) throws UnsupportedAudioFileException, IOException { - final AudioFileFormat format = getAudioFileFormat(stream); + final StandardFileFormat format = getAudioFileFormat(stream); + final AudioFormat af = format.getFormat(); + final long length = format.getLongFrameLength(); // we've got everything, the stream is supported and it is at the // beginning of the header, so find the data chunk again and return an // AudioInputStream @@ -269,8 +266,6 @@ while (riffiterator.hasNextChunk()) { RIFFReader chunk = riffiterator.nextChunk(); if (chunk.getFormat().equals("data")) { - final AudioFormat af = format.getFormat(); - final long length = chunk.getSize() / af.getFrameSize(); return new AudioInputStream(chunk, af, length); } }