I need to set byte value as method parameter. I have boolean variable isGenerated
, that determines the logic to be executed within this method. But I can pass direc
It is not odd. It is OK. The odd is that you need to transform typed boolean value to not self explainable byte. However sometimes we have to do this when working with legacy APIs.
BTW if you want to save memory you can use 1 bit instead of byte, so you can group several boolean flags together while using bit for each boolean value. But this technique is relevant for huge amounts of data only when saving several bytes can be significant.