I haven't done much Java programming but its syntax is C-based so all that stuff is the same in C# or C++ or pretty much any other C-based language.
The 'break' keyword breaks out of the current block. For instance, you might perform a loop and test a condition part way through and end the loop if it's true. VB.NET has equivalent Exit statements, e.g. Exit For, Exit Do, etc. I don't think VB6 has a direct equivalent so your best option would depend on the scenario. You may not have a choice but to use a GoTo.
The << and >> operators are bit-shift operators and they work on the binary form of a number. For instance, 00010100 (20) shifted 2 bits to the left would be 01010000 (80). If you shift all the digits in a decimal number one place to the left, it is equivalent to multiplying by 10. Because binary is base 2, shifting bits one place to the left is equivalent to multiplying by 2. I don;t know whether VB6 has bit-shift operators but you can look it up. If not then you can use multiplication and division instead.
The 'continue' keyword ends the current iteration of a loop and commences the next. VB.NET added an equivalent Continue keyword in its third or fourth generation. Prior to that, the recommendation was to use a GoTo to jump to a label at the very bottom inside the loop. That's what you'd have to do in VB6 too.
Most binary operators can be combined with an = to perform the binary operation using a variable and another value and then assign the result back to the same variable. This:
Code:
datum >>= code_size;
is equivalent to this:
Code:
datum = datum >> code_size;
As you haven't highlighted the += in this line:
Code:
datum += ( ( (int) block[ bi ] ) & 0xff ) << bits;
I assume that you are somewhat familiar with those combined binary assignment operators.
In C-based languages, an assignment actually returns a value, that being the value that assigned. As a result, you are able to chain assignments. This expression:assigns the value zero to the 'bi' variable and returns zero, so that expression can then be assigned to another variable:That means that this code:
Code:
datum = bits = count = first = top = pi = bi = 0;
is equivalent to:
Code:
bi = 0;
pi = bi;
top = pi;
first = top;
count = first;
bits = count;
datum = bits;
Basically that's a quick way to initialise several variables.
The ++ increment and -- decrement operators can be used pre and post. When you see '++var', the operator comes first so the increment comes first, i.e. increment the variable and then use the variable, so the new value gets used. When you see 'var++', the operator comes last so the increment comes last , i.e. use the variable and then increment the variable, so the old value gets used.