JDK-4444193 : java.io.IOException in service provider's getSoundBank(InputStream in)
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: client-libs
  • Sub-Component: javax.sound
  • Priority: P2
  • Affected Version: 1.4.0
  • OS: windows_2000
  • CPU: x86
  • Submit Date: 2001-04-13
  • Updated Date: 2002-05-14
  • Resolved Date: 2001-08-09
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
1.4.0 beta2Fixed
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