Commit d70dd6c8 by Tom Tromey Committed by Tom Tromey

* java/util/Properties.java: Re-merged from Classpath.

From-SVN: r45442
parent 1aae372e
2001-09-05 Tom Tromey <tromey@redhat.com> 2001-09-05 Tom Tromey <tromey@redhat.com>
* java/util/Properties.java: Re-merged from Classpath.
From Eric Blake, via Classpath: From Eric Blake, via Classpath:
* java/lang/String.java (CaseInsensitiveComparator): New class. * java/lang/String.java (CaseInsensitiveComparator): New class.
(CASE_INSENSITIVE_ORDER): Use instance of CaseInsensitiveComparator. (CASE_INSENSITIVE_ORDER): Use instance of CaseInsensitiveComparator.
......
/* java.util.Properties /* java.util.Properties
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -61,7 +61,8 @@ import java.io.*; ...@@ -61,7 +61,8 @@ import java.io.*;
* of <code>get/put</code>. * of <code>get/put</code>.
* *
* @see PropertyResourceBundle * @see PropertyResourceBundle
* @author Jochen Hoenicke */ * @author Jochen Hoenicke
*/
public class Properties extends Hashtable public class Properties extends Hashtable
{ {
/** /**
...@@ -128,8 +129,9 @@ public class Properties extends Hashtable ...@@ -128,8 +129,9 @@ public class Properties extends Hashtable
* from the input. */ * from the input. */
public void load(InputStream inStream) throws IOException public void load(InputStream inStream) throws IOException
{ {
// The spec says that the file must be encoded using ISO-8859-1.
BufferedReader reader = BufferedReader reader =
new BufferedReader(new InputStreamReader(inStream)); new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1"));
String line; String line;
while ((line = reader.readLine()) != null) while ((line = reader.readLine()) != null)
...@@ -302,7 +304,9 @@ public class Properties extends Hashtable ...@@ -302,7 +304,9 @@ public class Properties extends Hashtable
*/ */
public void store(OutputStream out, String header) throws IOException public void store(OutputStream out, String header) throws IOException
{ {
PrintWriter writer = new PrintWriter(out); // The spec says that the file must be encoded using ISO-8859-1.
PrintWriter writer
= new PrintWriter(new OutputStreamWriter (out, "ISO-8859-1"));
if (header != null) if (header != null)
writer.println("#" + header); writer.println("#" + header);
writer.println("#" + new Date().toString()); writer.println("#" + new Date().toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment