buf.length << 1 is a shift operation which is the same as buf.length*2. The Max() chooses the bigger value.
So that method is fine ;)
But a little too clever for my taste ;-). It reminds me of the old days with C compilers who weren't smart enough to convert a multiplication/division by a power of 2 into a left/right shift. I thought those days had passed forever, but it seems there's always someone thinking he can outsmart the compiler ;-).
Ugo
-- Ugo Cei - Consorzio di Bioingegneria e Informatica Medica P.le Volontari del Sangue, 2 - 27100 Pavia - Italy Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]
