/** * Decodes data from Base64 notation, automatically * detecting gzip-compressed data and decompressing it. * * @param s the string to decode * @return the decoded data * @since 1.4 */ public static byte[] decode( String s ) { return decode( s, NO_OPTIONS ); }
/** * Decodes a base64 String. * * @param data a base64 encoded String to decode. * @return the decoded String. */ public static byte[] decodeBase64(String data) { return Base64.decode(data); }
/** * Decodes data from Base64 notation, automatically * detecting gzip-compressed data and decompressing it. * * @param s the string to decode * @return the decoded data * @since 1.4 */ public static byte[] decode( String s ) { return decode( s, NO_OPTIONS ); }
/** * Decodes data from Base64 notation, automatically * detecting gzip-compressed data and decompressing it. * * @param s the string to decode * @return the decoded data * @since 1.4 */ public static byte[] decode( String s ) { return decode( s, NO_OPTIONS ); }
/** * Decodes a base64 String. * * @param data a base64 encoded String to decode. * @return the decoded String. */ public static byte[] decodeBase64(String data) { return Base64.decode(data); }
public String decode(String s) { return new String(Base64.decode(s)); }
/** * Decodes a base64 String. * Unlike Base64.decode() this method does not try to detect and decompress a gzip-compressed input. * * @param data a base64 encoded String to decode. * @return the decoded String. */ public static byte[] decodeBase64(String data) { byte[] bytes; try { bytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { bytes = data.getBytes(); } bytes = Base64.decode(bytes, 0, bytes.length, Base64.NO_OPTIONS); return bytes; }
public static Object stringToObject(String data) throws Exception { Object res = null; if (data != null) { ByteArrayInputStream bais = null; ObjectInputStream ois = null; try { byte[] bytes = Base64.decode(data, Base64.GZIP); bais = new ByteArrayInputStream(bytes); ois = new ObjectInputStream(bais); res = ois.readObject(); } finally { if (ois != null) { try { ois.close(); } catch (Exception e) { } } if (bais != null) { try { bais.close(); } catch (Exception e) { } } } } return res; } }
byte[] objBytes = decode( encodedObject );
byte[] objBytes = decode( encodedObject );
byte[] objBytes = decode( encodedObject );
bytes = decode( bytes, 0, bytes.length, options );
bytes = decode( bytes, 0, bytes.length, options );
bytes = decode( bytes, 0, bytes.length, options );
public void challengeReceived(String challenge) throws IOException { byte response[] = null; if (challenge != null) { String decodedResponse = new String(Base64.decode(challenge)); Map<String, String> parameters = getQueryMap(decodedResponse); Long callId = new GregorianCalendar().getTimeInMillis() / 1000;
String decodedResponse = new String(Base64.decode(challenge)); Map<String, String> parameters = getQueryMap(decodedResponse);
/** * The server is challenging the SASL mechanism for the stanza he just sent. Send a * response to the server's challenge. * * @param challenge a base64 encoded string representing the challenge. * @throws IOException if an exception sending the response occurs. */ public void challengeReceived(String challenge) throws IOException { byte response[]; if(challenge != null) { response = sc.evaluateChallenge(Base64.decode(challenge)); } else { response = sc.evaluateChallenge(new byte[0]); } Packet responseStanza; if (response == null) { responseStanza = new Response(); } else { responseStanza = new Response(Base64.encodeBytes(response,Base64.DONT_BREAK_LINES)); } // Send the authentication to the server getSASLAuthentication().send(responseStanza); }
/** * The server is challenging the SASL mechanism for the stanza he just sent. Send a * response to the server's challenge. * * @param challenge a base64 encoded string representing the challenge. * @throws IOException if an exception sending the response occurs. */ public void challengeReceived(String challenge) throws IOException { byte response[]; if(challenge != null) { response = sc.evaluateChallenge(Base64.decode(challenge)); } else { response = sc.evaluateChallenge(new byte[0]); } Packet responseStanza; if (response == null) { responseStanza = new Response(); } else { responseStanza = new Response(Base64.encodeBytes(response,Base64.DONT_BREAK_LINES)); } // Send the authentication to the server getSASLAuthentication().send(responseStanza); }