Skip to content

Update ImaDrum Money plugin#4169

Merged
Nightfirecat merged 2 commits into
runelite:masterfrom
EwwItsMike:master
Apr 11, 2023
Merged

Update ImaDrum Money plugin#4169
Nightfirecat merged 2 commits into
runelite:masterfrom
EwwItsMike:master

Conversation

@EwwItsMike
Copy link
Copy Markdown
Contributor

Fixed SoundclipManager.
Now uses BufferedInputStream to stream soundclips from resources.

It was throwing IOExceptions for not supporting mark/reset in regular InputStream.

Fixed SoundclipManager.
Now uses BufferedInputStream to stream soundclips from resources. 

It was throwing IOExceptions for not supporting mark/reset in regular InputStream
@runelite-github-app
Copy link
Copy Markdown

runelite-github-app Bot commented Apr 5, 2023

@LlemonDuck
Copy link
Copy Markdown
Contributor

You should wrap all three of these in a try-resource block, it's not as nest-y as you had it before either:

try (InputStream s = getClass().getResourceAsStream(sound.getFileName());
     InputStream bufferedIn = new BufferedInputStream(s);
     AudioInputStream audioStream = AudioSystem.getAudioInputStream(bufferedIn)) {
     // ...
}

Wrapped inputstreams in SoundClipManager.java in a try-resource block, as per LlemonDuck's request.
NPE's now also get caught.
@Nightfirecat Nightfirecat merged commit 5990606 into runelite:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants