Hence to avoid such errors occurred at compile time we have to typecast the result type from int type to short/byte as the arithmetic expression or the constant expression on the right-hand side of ...
The approach here is to use Java 9+ VarHandles to allow reading int/long/short as single cpu instructions and not manually recombining the bytes. The trick is to make a "view" var handle which allows ...