This content has been marked as final. Show 5 replies
1 person found this helpful
I am throwing an IOExceptionWith what message text?
"IOException: mark/reset not supported"
Sorry for not including this initially. I don't know how to retrieve error messages from Applets, and had to build a text field on the GUI itself to intercept the full message.
I recall running into this situation before, but not a solution. Is there a way to wrap the stream in something that CAN do a mark & reset? I will try this while awaiting further replies.
I just tried wrapping the InputStream from the FileOpenService in a BufferedInputStream and wrapping that in a PushbackInputStream. But I get a .markSupported() = false on the BushbackInputStream, so trying to get an AudioFileFormat still does not work.
I kind of need the AudioFileFormat in order to get the frame length of the audio file (used to build an internal array), as well as use it for prescreening supported audio file formats.
Is there be a way to make this file "markable"? Or should one take another approach?
You might try loading the entire input stream provided by the <tt>FileContents</tt> into a <tt>ByteArrayOutputStream</tt>. Provide the <tt>byte</tt> from that to the constructor of a <tt>ByteArrayInputStream</tt> & use the BAIS for further operations.
That was exactly what I was trying just now, and it worked. Since you already described the answer, I don't have to.
Many, many thanks!