< prev index next >

test/javax/sound/midi/Gervill/RiffReaderWriter/Skip.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2007, 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) 2007, 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.
*** 26,35 **** --- 26,37 ---- @modules java.desktop/com.sun.media.sound */ import java.io.File; import java.io.FileInputStream; + import java.nio.file.Files; + import java.nio.file.Paths; import com.sun.media.sound.RIFFReader; import com.sun.media.sound.RIFFWriter; public class Skip {
*** 72,92 **** RIFFReader readchunk = reader.nextChunk(); reader.skip(1); assertEquals(readchunk.read(), 44); fis.close(); reader = null; - - } finally { if(writer != null) writer.close(); if(reader != null) reader.close(); ! ! if(tempfile.exists()) ! if(!tempfile.delete()) ! tempfile.deleteOnExit(); } } } --- 74,89 ---- RIFFReader readchunk = reader.nextChunk(); reader.skip(1); assertEquals(readchunk.read(), 44); fis.close(); reader = null; } finally { if(writer != null) writer.close(); if(reader != null) reader.close(); ! Files.delete(Paths.get(tempfile.getAbsolutePath())); } } }
< prev index next >