< prev index next >

test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 28,37 **** --- 28,38 ---- import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.nio.file.Files; + import java.nio.file.Paths; import java.util.Arrays; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.spi.AudioFileReader;
*** 49,67 **** private static byte[] R = new byte[3]; public static void main(final String[] args) throws Exception { final File file = Files.createTempFile("audio", "test").toFile(); ! file.deleteOnExit(); try (final OutputStream fos = new FileOutputStream(file)) { fos.write(W); } - testAS(file); for (final AudioFileReader afr : load(AudioFileReader.class)) { testAFR(afr, file); } } /** * Tests the part of AudioSystem API, which implemented via * AudioFileReader. --- 50,70 ---- private static byte[] R = new byte[3]; public static void main(final String[] args) throws Exception { final File file = Files.createTempFile("audio", "test").toFile(); ! try { try (final OutputStream fos = new FileOutputStream(file)) { fos.write(W); } testAS(file); for (final AudioFileReader afr : load(AudioFileReader.class)) { testAFR(afr, file); } + } finally { + Files.delete(Paths.get(file.getAbsolutePath())); + } } /** * Tests the part of AudioSystem API, which implemented via * AudioFileReader.
< prev index next >