/[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.23 by smarothy, Mon Apr 18 22:17:49 2005 UTC revision 1.24 by smarothy, Mon Apr 25 23:18:30 2005 UTC
# Line 237  public class InputStreamReader extends R Line 237  public class InputStreamReader extends R
237      this.in = in;      this.in = in;
238      decoder = charset.newDecoder();      decoder = charset.newDecoder();
239    
240      // JDK reports errors, so we do the same.      decoder.onMalformedInput(CodingErrorAction.REPLACE);
241      decoder.onMalformedInput(CodingErrorAction.REPORT);      decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
     decoder.onUnmappableCharacter(CodingErrorAction.REPORT);  
242      decoder.reset();      decoder.reset();
243      encoding = EncodingHelper.getOldCanonical(charset.name());      encoding = EncodingHelper.getOldCanonical(charset.name());
244    }    }
# Line 258  public class InputStreamReader extends R Line 257  public class InputStreamReader extends R
257          maxBytesPerChar = 1f;          maxBytesPerChar = 1f;
258      }      }
259    
260      // JDK reports errors, so we do the same.      decoder.onMalformedInput(CodingErrorAction.REPLACE);
261      decoder.onMalformedInput(CodingErrorAction.REPORT);      decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
     decoder.onUnmappableCharacter(CodingErrorAction.REPORT);  
262      decoder.reset();      decoder.reset();
263      encoding = EncodingHelper.getOldCanonical(decoder.charset().name());            encoding = EncodingHelper.getOldCanonical(decoder.charset().name());      
264    }    }
# Line 390  public class InputStreamReader extends R Line 388  public class InputStreamReader extends R
388          } else          } else
389              byteBuffer = null;              byteBuffer = null;
390    
391          return (read == 0)?-1:(cb.position() - startPos);          read = cb.position() - startPos;
392            return (read <= 0) ? -1 : read;
393      } else {      } else {
394          byte[] bytes = new byte[length];          byte[] bytes = new byte[length];
395          int read = in.read(bytes);          int read = in.read(bytes);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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