Helper method to combine two bytes into a code unit. @param low 0..255; low byte @param high 0..255; high byte @return combined value
(int low, int high)
| 476 | * @return combined value |
| 477 | */ |
| 478 | protected static short codeUnit(int low, int high) { |
| 479 | if ((low & 0xff) != low) { |
| 480 | throw new IllegalArgumentException("low out of range 0..255"); |
| 481 | } |
| 482 | |
| 483 | if ((high & 0xff) != high) { |
| 484 | throw new IllegalArgumentException("high out of range 0..255"); |
| 485 | } |
| 486 | |
| 487 | return (short) (low | (high << 8)); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * Helper method to combine four nibbles into a code unit. |