< prev index next >

src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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.  Oracle designates this

@@ -35,10 +35,11 @@
 import java.io.FileOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.RandomAccessFile;
 import java.io.SequenceInputStream;
+import java.util.Objects;
 
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;

@@ -81,10 +82,13 @@
         return new AudioFileFormat.Type[0];
     }
 
 
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException {
+        Objects.requireNonNull(stream);
+        Objects.requireNonNull(fileType);
+        Objects.requireNonNull(out);
 
         // we must know the total data length to calculate the file length
         //$$fb 2001-07-13: fix for bug 4351296: do not throw an exception
         //if( stream.getFrameLength() == AudioSystem.NOT_SPECIFIED ) {
         //      throw new IOException("stream length not specified");

@@ -98,10 +102,13 @@
     }
 
 
 
     public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException {
+        Objects.requireNonNull(stream);
+        Objects.requireNonNull(fileType);
+        Objects.requireNonNull(out);
 
         // throws IllegalArgumentException if not supported
         AuFileFormat auFileFormat = (AuFileFormat)getAudioFileFormat(fileType, stream);
 
         // first write the file without worrying about length fields
< prev index next >