Author: remy.maucherat(a)jboss.com
Date: 2007-08-24 08:00:42 -0400 (Fri, 24 Aug 2007)
New Revision: 240
Modified:
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java
Log:
- B2C fix (which may occur when a char in incompletely read).
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java
===================================================================
---
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java 2007-08-24
12:00:13 UTC (rev 239)
+++
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java 2007-08-24
12:00:42 UTC (rev 240)
@@ -82,7 +82,7 @@
{
try {
// read from the reader
- while( true ) { // conv.ready() ) {
+ while( iis.available()>0 ) { // conv.ready() ) {
int cnt=conv.read( result, 0, BUFFER_SIZE );
if( cnt <= 0 ) {
// End of stream ! - we may be in a bad state
@@ -255,6 +255,9 @@
return (pos < end ) ? (buf[pos++] & 0xff) : -1;
}
+ public int available() throws IOException {
+ return end-pos;
+ }
// -------------------- Internal methods --------------------
void setBuffer( byte b[], int p, int l ) {
Show replies by date