for(int index = 0; index < al_In.size(); index++)
...
b = al_In.get(++index);
In some situation your code increment the variable twice in the loop,
which explains what you've been seeing. Nothing seems wrong with the
SDK.
JBQ
On Mon, Nov 24, 2008 at 3:58 AM, Linker <[EMAIL PROTECTED]> wrote:
>
> public ArrayList<Byte> Remove7D7E(ArrayList<Byte> al_In)
> {
> ArrayList<Byte> al_Out = new ArrayList<Byte>();
> Byte b = null;Byte tmp = null;
> for(int index = 0; index < al_In.size(); index++)
> {
> b = al_In.get(index);
> if(b == 0x7D)
> {
> b = al_In.get(++index);
> tmp = Byte.valueOf(String.valueOf(0x70 | (b &
> 0x0f)));
> al_Out.add(tmp);
> }
> else
> {
> al_Out.add(b);
> }
> }
> return al_Out;
> }
> 'index' will become 2 when in first loop.
> why?i am sure it's just first loop, index should be 0.
> int "index"= 2 ????????why???
> can anyone explain it?
> thank you.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---