int (char type) { int maxValue; switch (type) { case 'X': maxValue = 128; break; case 'B': maxValue = 127; break; case 'Y': maxValue = 32768; break; case 'S': maxValue = 32767; break; case 'C': maxValue = 0xFFFF; break; default: maxValue = Integer.MAX_VALUE; } return maxValue; }