harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-410) method decode(ByteBuffer, CharBuffer, boolean) should set correct position in ByteBuffer
Date Wed, 26 Apr 2006 09:18:03 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-410?page=comments#action_12376439 ] 

Richard Liang commented on HARMONY-410:

Hi Vladimir,

I think we both understand the spec :) 

Here I propose two solutions:

1. Set the ByteBuffer to the limit, and store the remaining ByteBuffer in decoder. Invokers
doesn't care the position of in. If the result is UNDERFLOW and there're furthur input, just
pass the new input to the decoder. It's a typical streaming decoder.  That's what Harmony
does currently.

2. Decoder doesn't store remaining ByteBuffer. Position of "in" is set to indicate the remaining
ByteBuffer. Invoker should take care to generate new input ByteBuffer for next invocation.
 RI acts in this way.

Both are acceptable. 

However, I think solution 1 is more reasonable.

"Is it possible to store bytes in decoder, support streaming decoding, and, at the same time
sets correct position in input buffer after each operation? "

Yes.  In fact, your patch will make Harmony act as the description above. 

However, I don't think it solve the problem. Maybe invoker is more confusable and may think:

"Is the remaining bytebuffer maintained in decoder or in ?  Shall I get the remaining buffer
from in and pass it for next invocation?"

Anyway, we need a decision on this compatibility issue.

By the way, Vladimir, does solution one cause any problem on other classlib implementation?

Thanks !

> method decode(ByteBuffer, CharBuffer, boolean) should set correct position in ByteBuffer
> ----------------------------------------------------------------------------------------
>          Key: HARMONY-410
>          URL: http://issues.apache.org/jira/browse/HARMONY-410
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Vladimir Strigun
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: Harmony-410_patch.txt, harmony-410_test.txt
> When ByteBuffer contain incomplete sequence of bytes for successful decoding, position
in ByteBuffer should be set to latest successful byte. I will attach testcase and patch soon.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message