Helper method to combine two nibbles into a byte. @param low 0..15; low nibble @param high 0..15; high nibble @return 0..255; combined value
(int low, int high)
| 524 | * @return {@code 0..255;} combined value |
| 525 | */ |
| 526 | protected static int makeByte(int low, int high) { |
| 527 | if ((low & 0xf) != low) { |
| 528 | throw new IllegalArgumentException("low out of range 0..15"); |
| 529 | } |
| 530 | |
| 531 | if ((high & 0xf) != high) { |
| 532 | throw new IllegalArgumentException("high out of range 0..15"); |
| 533 | } |
| 534 | |
| 535 | return low | (high << 4); |
| 536 | } |
| 537 | |
| 538 | /** |
| 539 | * Writes one code unit to the given output destination. |