public byte[] decodeBuffer(String encoded) throws IOException {

		StringBuffer buff = new StringBuffer(encoded.length());
		for (int i = 0; i < encoded.length(); ++i) {
			char c = encoded.charAt(i);
			if (c == '-') {
				c = '+';
			} else if (c == '.') {
				c = '/';
			} else if (c == '_') {
				c = '=';
			}
			buff.append(c);
		}

		return Base64.decodeBase64(buff.toString().getBytes());
	}