< prev index next >

src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java

Print this page

        

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

@@ -23,11 +23,11 @@
  * questions.
  */
 
 package javax.sound.sampled.spi;
 
-import java.util.stream.Stream;
+import java.util.Arrays;
 
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
 
 import static javax.sound.sampled.AudioFormat.Encoding;

@@ -80,11 +80,12 @@
      * @return {@code true} if the encoding is supported, otherwise
      *         {@code false}
      * @throws NullPointerException if {@code sourceEncoding} is {@code null}
      */
     public boolean isSourceEncodingSupported(final Encoding sourceEncoding) {
-        return Stream.of(getSourceEncodings()).anyMatch(sourceEncoding::equals);
+        return Arrays.stream(getSourceEncodings())
+                     .anyMatch(sourceEncoding::equals);
     }
 
     /**
      * Indicates whether the format converter supports conversion to the
      * specified target format encoding.

@@ -94,11 +95,12 @@
      * @return {@code true} if the encoding is supported, otherwise
      *         {@code false}
      * @throws NullPointerException if {@code targetEncoding} is {@code null}
      */
     public boolean isTargetEncodingSupported(final Encoding targetEncoding) {
-        return Stream.of(getTargetEncodings()).anyMatch(targetEncoding::equals);
+        return Arrays.stream(getTargetEncodings())
+                     .anyMatch(targetEncoding::equals);
     }
 
     /**
      * Obtains the set of target format encodings supported by the format
      * converter given a particular source format. If no target format encodings

@@ -121,11 +123,11 @@
      * @throws NullPointerException if {@code targetEncoding} or
      *         {@code sourceFormat} are {@code null}
      */
     public boolean isConversionSupported(final Encoding targetEncoding,
                                          final AudioFormat sourceFormat) {
-        return Stream.of(getTargetEncodings(sourceFormat))
+        return Arrays.stream(getTargetEncodings(sourceFormat))
                      .anyMatch(targetEncoding::equals);
     }
 
     /**
      * Obtains the set of target formats with the encoding specified supported

@@ -153,11 +155,11 @@
      *         {@code sourceFormat} are {@code null}
      */
     public boolean isConversionSupported(final AudioFormat targetFormat,
                                          final AudioFormat sourceFormat) {
         final Encoding targetEncoding = targetFormat.getEncoding();
-        return Stream.of(getTargetFormats(targetEncoding, sourceFormat))
+        return Arrays.stream(getTargetFormats(targetEncoding, sourceFormat))
                      .anyMatch(targetFormat::matches);
     }
 
     /**
      * Obtains an audio input stream with the specified encoding from the given
< prev index next >