JDK-4935508 : SPEC: AudioInputStream.read should specify non-integral frame size behavior
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_98
  • CPU: x86
  • Submitted: 2003-10-09
  • Updated: 2017-05-16
  • Resolved: 2003-11-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 b28Fixed
Description
Name: rmT116609			Date: 10/09/2003


A DESCRIPTION OF THE REQUEST :
In the Javadoc for the AudioInputStream.read(...) methods, it would be good to mention that, like TargetDataLine.read method, the number of bytes actually read is always a multiple of the frame size (in bytes).

If the number of bytes asked is not a multiple of the frame size, the AudioInputStream.read(...) method will append zeros at the end of the array, unlike the TargetDataLine method who will throw an IllegalArgumentException!

JUSTIFICATION :
necessary for clarity :-)
(Incident Review ID: 214413) 
======================================================================
###@###.### 2003-11-03
Checked in fix

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b28 tiger-beta
2004-06-14

EVALUATION ###@###.### 2003-10-10 Sounds like a valid request. I'm not sure how to solve this missing spec: 1) throw IAE if number of requested bytes is not integral frame 2) only read rounded down number of bytes (what I see as current behavior) 3) current behavior, what he claims: append 0's ???? should *not* be done. I tend to 2) and that it should be documented. Introducing IAE for that would unnecessarily break existing apps. 3) doesn't make sense. Therefore, I change this bug to be a spec bug.
2004-06-11

PUBLIC COMMENTS AudioInputStream.read should specify non-integral frame size behavior
2004-06-10