public void appendChar(int x) {
        while (length + 1 >= elems.length) copy(elems.length * 2);
        elems[length  ] = (byte)((x >>  8) & 0xFF);
        elems[length+1] = (byte)((x      ) & 0xFF);
        length = length + 2;
    }