United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4444193 : java.io.IOException in service provider's getSoundBank(InputStream in)

Details
Type:
Bug
Submit Date:
2001-04-13
Status:
Closed
Updated Date:
2002-05-14
Project Name:
JDK
Resolved Date:
2001-08-09
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.sound
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.0 (beta2)

Related Reports

Sub Tasks

Description
When   MidiSystem.getSoundbank(InputStream stream) method is invoked the MidiSystem class looks for all the SoundbankReaders available to the system.
The default SoundbankReader of the jdk, HsbParser gets activated and in turn calls HeadspaceSoundbank(InputStream stream) constructor.  
Now apart from the default SoundbankReader, a third party implementation of some SoundbankReader (for eg. MsbReader) can also exists.   
If MidiSystem.getSoundbank(InputStream stream) method is called to get a Soundbank which is not supported by the default SoundbankReader but is supported by MsbReader, it throws the following exceptions                                    
 java.io.IOException:Bad File Descriptor  at
 java.io.FileInputStream.read(Native Method) at 
 java.io.DataInputStream.readShort(DataInputStream.java:321)  at
 com.MID_Services.MsbReader.getSoundbank(MsbReader.java:86)  at 
 javax.sound.midi.MidiSystem.getSoundbank(MidiSystem.java:290) at
 javax.sound.midi.MidiSystem.getSoundbank(MidiSystem.java:349)  at
 test0006.runTest(test0006.java:105) at TRTest.start(TRTest.java:137) at
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:30)     at
sun.reflect.InflatableMethodAccessorImpl.invoke(InflatableMethodAccessorImpl.java:48)    at 
 java.lang.reflect.Method.invoke(Method.java:306)  at
 TestRunner.runTest(TestRunner.java:261) at
 TestRunner.compileAndRunTests(TestRunner.java:210) at
 TestRunner.main(TestRunner.java:143)

MsbReader.java is a test implementation of SoundbankReader which is called by MidiSystem after HsbParser.java is invoked.



                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta2

FIXED IN:
merlin-beta2

INTEGRATED IN:
merlin-beta2

VERIFIED IN:
merlin-beta2


                                     
2004-06-14
EVALUATION

###@###.### 2001-07-17
This bug touches several bugs in the current soundbank reader. 
One part is fixed, the main problem remains: it reads the entire stream before parsing the header and evaluating whether it's a valid headspace soundbank.
To entirely fix it, more work needs to be done on native code.
                                     
2004-06-11
PUBLIC COMMENTS

java.io.IOException in service provider's getSoundBank(InputStream in)
                                     
2004-06-10
WORK AROUND

###@###.### 2001-07-17
	Do not use an InputStream when opening a soundbank. Use File or URL instead.
                                     
2001-07-17
SUGGESTED FIX


###@###.### 2001-07-17
	Part of fix done in HeadspaceSoundbank.java. Next step for Tiger is to add a native function "isHeadspaceSoundbank" or similar, which only needs some bytes.
                                     
2001-07-17



Hardware and Software, Engineered to Work Together