/[classpath]/classpath/java/io/InputStreamReader.java
ViewVC logotype

Diff of /classpath/java/io/InputStreamReader.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by rschuster, Tue Feb 22 03:27:34 2005 UTC revision 1.21 by tromey, Thu Mar 10 19:35:51 2005 UTC
# Line 147  public class InputStreamReader extends R Line 147  public class InputStreamReader extends R
147     * Creates an InputStreamReader that uses a decoder of the given     * Creates an InputStreamReader that uses a decoder of the given
148     * charset to decode the bytes in the InputStream into     * charset to decode the bytes in the InputStream into
149     * characters.     * characters.
150       * @since 1.4
151     */     */
152    public InputStreamReader(InputStream in, Charset charset) {    public InputStreamReader(InputStream in, Charset charset)
153      {
154      /* FIXME: InputStream is wrapped in Channel which is read by a      /* FIXME: InputStream is wrapped in Channel which is read by a
155       * Reader-implementation for channels. However to fix this we       * Reader-implementation for channels. However to fix this we
156       * need to completely move to NIO-style character       * need to completely move to NIO-style character
157       * encoding/decoding.       * encoding/decoding.
158       */       */
159      this.in = Channels.newReader(Channels.newChannel(in), charset.newDecoder(), -1);      this.in = Channels.newReader(Channels.newChannel(in), charset.newDecoder(),
160                                         -1);
161      encoding = charset.name();      encoding = charset.name();
162    }    }
163    
164    /**    /**
165     * Creates an InputStreamReader that uses the given charset decoder     * Creates an InputStreamReader that uses the given charset decoder
166     * to decode the bytes in the InputStream into characters.     * to decode the bytes in the InputStream into characters.
167       * @since 1.4
168     */     */
169    public InputStreamReader(InputStream in, CharsetDecoder decoder) {    public InputStreamReader(InputStream in, CharsetDecoder decoder)
170      {
171      // FIXME: see {@link InputStreamReader(InputStream, Charset)      // FIXME: see {@link InputStreamReader(InputStream, Charset)
172      this.in = Channels.newReader(Channels.newChannel(in), decoder, -1);      this.in = Channels.newReader(Channels.newChannel(in), decoder, -1);
       
173      encoding = decoder.charset().name();      encoding = decoder.charset().name();
174    }    }
175        

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26