You'll need to compare against 256 here, since Byte.MAX_VALUE is 128.