public static Base64Url encode(byte[] bytes) {
        if (bytes == null) {
            return new Base64Url(null);
        } else {
            return new Base64Url(BaseEncoding.base64Url().omitPadding().encode(bytes));
        }
    }
public static Base64Url encode ( byte [ ] bytes ) { if ( bytes == null ) { return new Base64Url ( null ) ; } else { return new Base64Url ( BaseEncoding . base64Url ( ) . omitPadding ( ) . encode ( bytes ) ) ; } }
Encode a byte array into Base64Url encoded bytes.

@param bytes The byte array to encode.
@return a Base64Url instance