harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Beyer <ndbe...@apache.org>
Subject Re: svn commit: r770302 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java
Date Thu, 30 Apr 2009 16:41:56 GMT
I'm curious about this change. There's no declaration of UTF-8 as the
encoding, how is that getting set? AIUI the InputStreamReader will use
the default encoding of the operating system.

-Nathan

On Thu, Apr 30, 2009 at 10:54 AM,  <odeakin@apache.org> wrote:
> Author: odeakin
> Date: Thu Apr 30 15:54:29 2009
> New Revision: 770302
>
> URL: http://svn.apache.org/viewvc?rev=770302&view=rev
> Log:
> Minor change to ensure we read test data back in UTF-8.
>
> Modified:
>    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java
>
> Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java?rev=770302&r1=770301&r2=770302&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java
(original)
> +++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileInputStreamTest.java
Thu Apr 30 15:54:29 2009
> @@ -19,6 +19,7 @@
>
>  import java.io.File;
>  import java.io.FileInputStream;
> +import java.io.InputStreamReader;
>  import java.io.FileOutputStream;
>  import java.io.FilePermission;
>  import java.io.IOException;
> @@ -109,9 +110,9 @@
>      * @tests java.io.FileInputStream#read()
>      */
>     public void test_read() throws IOException {
> -        is = new FileInputStream(fileName);
> -        int c = is.read();
> -        is.close();
> +        InputStreamReader isr = new InputStreamReader(new FileInputStream(fileName));
> +        int c = isr.read();
> +        isr.close();
>         assertTrue("read returned incorrect char", c == fileString.charAt(0));
>     }
>
>
>
>

Mime
View raw message