if (b >= 0 && urlsafe.get(b)) {
if (b < 0) { b = 256 + b; } if (urlsafe.get(b)) {
    public static final byte[] encodeUrl(BitSet urlsafe, byte[] pArray)     {        if (pArray == null) {            return null;        }        if (urlsafe == null) {            urlsafe = WWW_FORM_URL;        }                ByteArrayOutputStream buffer = new ByteArrayOutputStream();         for (int i = 0; i < pArray.length; i++) {            int b = pArray[i];            if (b >= 0 && urlsafe.get(b)) {                if (b == ' ') {                    b = '+';                }                buffer.write(b);            } else {                buffer.write('%');                char hex1 = Character.toUpperCase(                  Character.forDigit((b >> 4) & 0xF, 16));                char hex2 = Character.toUpperCase(                  Character.forDigit(b & 0xF, 16));                buffer.write(hex1);                buffer.write(hex2);            }        }        return buffer.toByteArray();     }