United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4935508 : SPEC: AudioInputStream.read should specify non-integral frame size behavior

Details
Type:
Enhancement
Submit Date:
2003-10-09
Status:
Resolved
Updated Date:
2003-11-07
Project Name:
JDK
Resolved Date:
2003-11-07
Component:
client-libs
OS:
windows_98
Sub-Component:
javax.sound
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
5.0 (b28)

Related Reports

Sub Tasks

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
PUBLIC COMMENTS

AudioInputStream.read should specify non-integral frame size behavior
                                     
2004-06-10
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
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b28
tiger-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together