jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingClip.java
changeset 41790 88b6889f7c39
parent 40444 afabcfc2f3ef
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingClip.java	Fri Oct 14 11:11:19 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingClip.java	Fri Oct 14 21:43:00 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, 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
@@ -363,9 +363,7 @@
             if (AudioFloatConverter.getConverter(format) == null)
                 throw new IllegalArgumentException("Invalid format : "
                         + format.toString());
-            if (bufferSize % format.getFrameSize() != 0)
-                throw new IllegalArgumentException(
-                        "Buffer size does not represent an integral number of sample frames!");
+            Toolkit.validateBuffer(format.getFrameSize(), bufferSize);
 
             if (data != null) {
                 this.data = Arrays.copyOf(data, data.length);