public byte[] getIncomingSoundBytes() { return StringUtils.decodeBase64(incomingSound); }
public byte[] getOutgoingSoundBytes() { return StringUtils.decodeBase64(outgoingSound); }
public byte[] getIncomingSoundBytes() { return StringUtils.decodeBase64(incomingSound); }
public byte[] getOutgoingSoundBytes() { return StringUtils.decodeBase64(outgoingSound); }
public byte[] getIncomingSoundBytes() { return StringUtils.decodeBase64(incomingSound); }
public byte[] getOutgoingSoundBytes() { return StringUtils.decodeBase64(outgoingSound); }
/** * Return the byte representation of the avatar(if one exists), otherwise returns null if * no avatar could be found. * <b>Example 1</b> * <pre> * // Load Avatar from VCard * byte[] avatarBytes = vCard.getAvatar(); * <p/> * // To create an ImageIcon for Swing applications * ImageIcon icon = new ImageIcon(avatar); * <p/> * // To create just an image object from the bytes * ByteArrayInputStream bais = new ByteArrayInputStream(avatar); * try { * Image image = ImageIO.read(bais); * } * catch (IOException e) { * e.printStackTrace(); * } * </pre> * * @return byte representation of avatar. */ public byte[] getAvatar() { if (avatar == null) { return null; } return StringUtils.decodeBase64(avatar); }
/** * Return the byte representation of the avatar(if one exists), otherwise returns null if * no avatar could be found. * <b>Example 1</b> * <pre> * // Load Avatar from VCard * byte[] avatarBytes = vCard.getAvatar(); * <p/> * // To create an ImageIcon for Swing applications * ImageIcon icon = new ImageIcon(avatar); * <p/> * // To create just an image object from the bytes * ByteArrayInputStream bais = new ByteArrayInputStream(avatar); * try { * Image image = ImageIO.read(bais); * } * catch (IOException e) { * e.printStackTrace(); * } * </pre> * * @return byte representation of avatar. */ public byte[] getAvatar() { if (avatar == null) { return null; } return StringUtils.decodeBase64(avatar); }
/** * Return the byte representation of the avatar(if one exists), otherwise returns null if * no avatar could be found. * <b>Example 1</b> * <pre> * // Load Avatar from VCard * byte[] avatarBytes = vCard.getAvatar(); * <p/> * // To create an ImageIcon for Swing applications * ImageIcon icon = new ImageIcon(avatar); * <p/> * // To create just an image object from the bytes * ByteArrayInputStream bais = new ByteArrayInputStream(avatar); * try { * Image image = ImageIO.read(bais); * } * catch (IOException e) { * e.printStackTrace(); * } * </pre> * * @return byte representation of avatar. */ public byte[] getAvatar() { if (avatar == null) { return null; } return StringUtils.decodeBase64(avatar); }
return StringUtils.decodeBase64(avatar);
/** * Returns the decoded data or null if data could not be decoded. * <p> * The encoded data is invalid if it contains bad Base64 input characters or * if it contains the pad ('=') character on a position other than the last * character(s) of the data. See <a * href="http://xmpp.org/extensions/xep-0047.html#sec">XEP-0047</a> Section * 6. * * @return the decoded data */ public byte[] getDecodedData() { // return cached decoded data if (this.decodedData != null) { return this.decodedData; } // data must not contain the pad (=) other than end of data if (data.matches(".*={1,2}+.+")) { return null; } // decodeBase64 will return null if bad characters are included this.decodedData = StringUtils.decodeBase64(data); return this.decodedData; }
/** * Decodes a base64 String. * * @param data a base64 encoded String to decode. * @return the decoded String. */ public static byte[] decodeBase64(String data) { byte [] bytes = null; try { bytes = data.getBytes("ISO-8859-1"); return decodeBase64(bytes).getBytes("ISO-8859-1"); } catch (UnsupportedEncodingException uee) { uee.printStackTrace(); } return new byte[] { }; }
/** * Returns the decoded data or null if data could not be decoded. * <p> * The encoded data is invalid if it contains bad Base64 input characters or * if it contains the pad ('=') character on a position other than the last * character(s) of the data. See <a * href="http://xmpp.org/extensions/xep-0047.html#sec">XEP-0047</a> Section * 6. * * @return the decoded data */ public byte[] getDecodedData() { // return cached decoded data if (this.decodedData != null) { return this.decodedData; } // data must not contain the pad (=) other than end of data if (data.matches(".*={1,2}+.+")) { return null; } // decodeBase64 will return null if bad characters are included this.decodedData = StringUtils.decodeBase64(data); return this.decodedData; }
/** * Returns the decoded data or null if data could not be decoded. * <p> * The encoded data is invalid if it contains bad Base64 input characters or * if it contains the pad ('=') character on a position other than the last * character(s) of the data. See <a * href="http://xmpp.org/extensions/xep-0047.html#sec">XEP-0047</a> Section * 6. * * @return the decoded data */ public byte[] getDecodedData() { // return cached decoded data if (this.decodedData != null) { return this.decodedData; } // data must not contain the pad (=) other than end of data if (data.matches(".*={1,2}+.+")) { return null; } // decodeBase64 will return null if bad characters are included this.decodedData = StringUtils.decodeBase64(data); return this.decodedData; }
/** * 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. */ public void challengeReceived(String challenge) throws IOException { // Build the challenge response stanza encoding the response text StringBuffer stanza = new StringBuffer(); stanza.append("<response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"); String authenticationText = getChallengeResponse(StringUtils.decodeBase64(challenge)); if (authenticationText != null) { stanza.append(StringUtils.encodeBase64(authenticationText)); } stanza.append("</response>"); // Send the authentication to the server getSASLAuthentication().send(stanza.toString()); }
} else if ("java-object".equals(type)) { try { byte[] bytes = StringUtils.decodeBase64(valueText); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); value = in.readObject();
byte [] bytes = StringUtils.decodeBase64(valueText); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); value = in.readObject();
byte [] bytes = StringUtils.decodeBase64(valueText); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); value = in.readObject();
byte [] bytes = StringUtils.decodeBase64(valueText); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); value = in.readObject();
/** * 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(StringUtils.decodeBase64(challenge)); } else { response = sc.evaluateChallenge(new byte[0]); } Packet responseStanza; if (response == null) { responseStanza = new Response(); } else { responseStanza = new Response(StringUtils.encodeBase64(response, false)); } // Send the authentication to the server getSASLAuthentication().send(responseStanza); }