< prev index next >

test/javax/sound/midi/Gervill/RiffReaderWriter/ReadInt.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,39 **** @modules java.desktop/com.sun.media.sound */ import java.io.File; import java.io.FileInputStream; ! import javax.sound.sampled.*; ! ! import com.sun.media.sound.*; public class ReadInt { private static void assertEquals(Object a, Object b) throws Exception { --- 26,40 ---- @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 ReadInt { private static void assertEquals(Object a, Object b) throws Exception {
*** 59,79 **** RIFFReader readchunk = reader.nextChunk(); assertEquals(readchunk.getFormat(), "TSCH"); assertEquals(reader.readInt(), 133); fis.close(); reader = null; - - } finally { if(writer != null) writer.close(); if(reader != null) reader.close(); ! ! if(tempfile.exists()) ! if(!tempfile.delete()) ! tempfile.deleteOnExit(); } } } --- 60,75 ---- RIFFReader readchunk = reader.nextChunk(); assertEquals(readchunk.getFormat(), "TSCH"); assertEquals(reader.readInt(), 133); fis.close(); reader = null; } finally { if(writer != null) writer.close(); if(reader != null) reader.close(); ! Files.delete(Paths.get(tempfile.getAbsolutePath())); } } }
< prev index next >