mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8234147: Avoid looking up standard charsets in core libraries
Reviewed-by: alanb
This commit is contained in:
parent
4e64af81a2
commit
cd589d8469
36 changed files with 200 additions and 237 deletions
|
@ -70,12 +70,8 @@ public class InputStreamReader extends Reader {
|
|||
*/
|
||||
public InputStreamReader(InputStream in) {
|
||||
super(in);
|
||||
try {
|
||||
sd = StreamDecoder.forInputStreamReader(in, this, (String)null); // ## check lock object
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// The default encoding should always be available
|
||||
throw new Error(e);
|
||||
}
|
||||
sd = StreamDecoder.forInputStreamReader(in, this,
|
||||
Charset.defaultCharset()); // ## check lock object
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,11 +106,8 @@ public class OutputStreamWriter extends Writer {
|
|||
*/
|
||||
public OutputStreamWriter(OutputStream out) {
|
||||
super(out);
|
||||
try {
|
||||
se = StreamEncoder.forOutputStreamWriter(out, this, (String)null);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
se = StreamEncoder.forOutputStreamWriter(out, this,
|
||||
Charset.defaultCharset());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue