bipush <n><n> is an integer >= -128 and <= 127 that is pushed onto the stack.
Stack Before
Description After ... <n> ... ...
bipush takes a single parameter, <n> (an 8-bit signed integer), sign extends it to a 32-bit int, and pushes the resulting int value onto the operand stack.
bipush is typically more efficient than ldc. It also occupies fewer bytes in the class file.
Example
bipush 0x10 ; push the value 0x10 (16) onto the operand stackBytecode
The bipush opcode is followed in the bytecode by an 8-bit signed byte specifying the integer value to push.
Type | Description |
u1 | bipush opcode = 0x10 (16) |
s1 | <n> |
sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_m1, iconst_<n>, lconst_<l>, fconst_<f>, dconst_<d>