Skip to content

Commit 92eae7f

Browse files
committed
remove dumb UnsupportedEncodingException stuff that is no longer necessary
1 parent 49475c6 commit 92eae7f

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

core/src/processing/core/PApplet.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import java.io.*;
5858
import java.lang.reflect.*;
5959
import java.net.*;
60+
import java.nio.charset.StandardCharsets;
6061
import java.text.*;
6162
import java.util.*;
6263
import java.util.regex.*;
@@ -6562,10 +6563,8 @@ static public BufferedReader createReader(File file) {
65626563
* following lines any more I'm gonna send Sun my medical bills.
65636564
*/
65646565
static public BufferedReader createReader(InputStream input) {
6565-
InputStreamReader isr = null;
6566-
try {
6567-
isr = new InputStreamReader(input, "UTF-8");
6568-
} catch (UnsupportedEncodingException e) { } // not gonna happen
6566+
InputStreamReader isr =
6567+
new InputStreamReader(input, StandardCharsets.UTF_8);
65696568
return new BufferedReader(isr);
65706569
}
65716570

@@ -6625,12 +6624,10 @@ static public PrintWriter createWriter(File file) {
66256624
* It's the JavaSoft API engineers who need to explain themselves.
66266625
*/
66276626
static public PrintWriter createWriter(OutputStream output) {
6628-
try {
6629-
BufferedOutputStream bos = new BufferedOutputStream(output, 8192);
6630-
OutputStreamWriter osw = new OutputStreamWriter(bos, "UTF-8");
6631-
return new PrintWriter(osw);
6632-
} catch (UnsupportedEncodingException e) { } // not gonna happen
6633-
return null;
6627+
BufferedOutputStream bos = new BufferedOutputStream(output, 8192);
6628+
OutputStreamWriter osw =
6629+
new OutputStreamWriter(bos, StandardCharsets.UTF_8);
6630+
return new PrintWriter(osw);
66346631
}
66356632

66366633

0 commit comments

Comments
 (0)