Imported GNU Classpath 0.90
Imported GNU Classpath 0.90
* scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
* gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
* java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
* java/lang/Math.java: New override file.
* java/lang/Character.java: Merged from Classpath.
(start, end): Now 'int's.
(canonicalName): New field.
(CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
(UnicodeBlock): Added argument.
(of): New overload.
(forName): New method.
Updated unicode blocks.
(sets): Updated.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r111942
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* InputStreamReader.java -- Reader than transforms bytes to chars
|
||||
Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@@ -38,6 +39,7 @@ exception statement from your version. */
|
||||
|
||||
package java.io;
|
||||
|
||||
import gnu.classpath.SystemProperties;
|
||||
import gnu.java.nio.charset.EncodingHelper;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -145,7 +147,7 @@ public class InputStreamReader extends Reader
|
||||
this.in = in;
|
||||
try
|
||||
{
|
||||
encoding = System.getProperty("file.encoding");
|
||||
encoding = SystemProperties.getProperty("file.encoding");
|
||||
// Don't use NIO if avoidable
|
||||
if(EncodingHelper.isISOLatin1(encoding))
|
||||
{
|
||||
@@ -231,12 +233,20 @@ public class InputStreamReader extends Reader
|
||||
* charset to decode the bytes in the InputStream into
|
||||
* characters.
|
||||
*
|
||||
* @since 1.5
|
||||
* @since 1.4
|
||||
*/
|
||||
public InputStreamReader(InputStream in, Charset charset) {
|
||||
if (in == null)
|
||||
throw new NullPointerException();
|
||||
this.in = in;
|
||||
decoder = charset.newDecoder();
|
||||
|
||||
try {
|
||||
maxBytesPerChar = charset.newEncoder().maxBytesPerChar();
|
||||
} catch(UnsupportedOperationException _){
|
||||
maxBytesPerChar = 1f;
|
||||
}
|
||||
|
||||
decoder.onMalformedInput(CodingErrorAction.REPLACE);
|
||||
decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
|
||||
decoder.reset();
|
||||
@@ -247,9 +257,11 @@ public class InputStreamReader extends Reader
|
||||
* Creates an InputStreamReader that uses the given charset decoder
|
||||
* to decode the bytes in the InputStream into characters.
|
||||
*
|
||||
* @since 1.5
|
||||
* @since 1.4
|
||||
*/
|
||||
public InputStreamReader(InputStream in, CharsetDecoder decoder) {
|
||||
if (in == null)
|
||||
throw new NullPointerException();
|
||||
this.in = in;
|
||||
this.decoder = decoder;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user