我已經閱讀了類似的頁面,爲什麼會發生這種情況,但其中沒有一個實際解釋瞭如何解決這個問題。如何修復BufferedInputStream的重置爲無效標記錯誤?
我的程序正在將字節數組轉換爲.wav文件,並且字節數組中有大約2百萬個值。
String uploadedFileLocation = "C:\\";
AudioInputStream source;
AudioInputStream pcm;
InputStream b_in = new ByteArrayInputStream(byteArray);
source = AudioSystem.getAudioInputStream(new BufferedInputStream(b_in));
pcm = AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED, source);
File newFile = new File(uploadedFileLocation + fileName);
AudioSystem.write(pcm, AudioFileFormat.Type.WAVE, newFile);
source.close();
pcm.close();
什麼標記/重置?這裏沒有。 – EJP
@downvoter,解釋它爲什麼不好。 – HarrietTubmanFan69
這很糟糕,因爲您沒有提供任何證據表明調用了「mark()」或「reset()」,並且因爲您的編輯對現有答案進行了無稽之談。 – EJP