-
Bug
-
Resolution: Won't Fix
-
P5
-
None
-
1.4.0
-
None
-
generic
-
generic
The behavior of ByteToCharISO8859_1.convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd) is confusing in following cases.
For any valid input and output arrays:
Case 1: inOff=-10, inEnd=5, outOff=55, outEnd=50
The method throws a sun.io.ConversionBufferFullException.
Case 2: inOff=-10, inEnd=-15, outOff=55, outEnd=50
No exception and returns -5.
The above results are very confusing. The javadoc says that ConversionBufferFullException is being thrown if output array is filled prior to converting all the input. In both of above cases, no characters is filled to the output array. So the output array is never full as long as it's length > 0. So the ConversionBufferFullException is not correct in the first case. In the second case, the return value is -5, which means -5 inputs were converted. This is also confusing because there is really no byte converted.
For any valid input and output arrays:
Case 1: inOff=-10, inEnd=5, outOff=55, outEnd=50
The method throws a sun.io.ConversionBufferFullException.
Case 2: inOff=-10, inEnd=-15, outOff=55, outEnd=50
No exception and returns -5.
The above results are very confusing. The javadoc says that ConversionBufferFullException is being thrown if output array is filled prior to converting all the input. In both of above cases, no characters is filled to the output array. So the output array is never full as long as it's length > 0. So the ConversionBufferFullException is not correct in the first case. In the second case, the return value is -5, which means -5 inputs were converted. This is also confusing because there is really no byte converted.