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 |
} |
} |
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 |
} |
} |
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); |