code: private static final <T extends Appendable> void appendEncodedByte(T buffer, byte value,
              byte[] state) {
          try {
              if (state[0] != 0) {
                  char c = (char) ((state[1] << 8) | ((value) & 0xFF));
                  buffer.append(c);
                  state[0] = 0;
              }
              else {
                  state[0] = 1;
                  state[1] = value;
              }
          } catch (IOException e) {
              throw new IllegalIcuArgumentException(e);
          }
      }
docs: Append a byte to the given Appendable, packing two bytes into each
  character.  The state parameter maintains intermediary data between
  calls.
  @param state A two-element array, with state[0] == 0 if this is the
  first byte of a pair, or state[0] != 0 if this is the second byte
  of a pair, in which case state[1] is the first byte.