Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7561077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:04:36+00:00 2026-05-30T13:04:36+00:00

According to the Javadoc, android.util.Base64.decode() takes two parameters: the text, and flags. These flags

  • 0

According to the Javadoc, android.util.Base64.decode() takes two parameters: the text, and “flags”. These flags are in int form and (I quote):

flags controls certain features of the decoded output. Pass DEFAULT to decode standard Base64.

First off, thanks to whomever decided to write a vague Javadoc. I see that Base64 has some enumeration strings, and in practice, we have been using Base64.NO_WRAP as our flag. In this particular instance, however, we need to employ two flags: NO_WRAP, and URL_SAFE.

How do we specify both flags? We tried separating them with a pipe (‘|’), and that didn’t do it.

import android.util.Base64;
public class Foo {
    public static void main(String[] args) {
        String urlSafeBase64EncodedString = getUrlSafeBase64EncodedString();
        int flags = ????????; //Need both Base64.NO_WRAP and Base64.URL_SAFE
        String decodedString = Base64.decode(urlSafeBase64EncodedString, flags);
    }
}

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:04:38+00:00Added an answer on May 30, 2026 at 1:04 pm

    int flags passed to functions are usually defined to be bitwise ORed to achieve a combined effect.

    You can usually tell by looking at the constant values, they would go 0 1 2 4 8 16 ..

    As for your question you can use the following for your flag definition:

    int flags = Base64.NO_WRAP | Base64.URL_SAFE;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In App Engine, according to the JavaDoc , the getTypeRank method has this signature:
According to MSDN form.RightToLeftLayout = True; form.RightToLeft = ifWeWantRTL() ? RightToLeft.True : RightToLeft.False; is
According to Serializable javadoc, readResolve() is intended for replacing an object read from the
I'm having issues parsing some XML using DefaultHandler2. My XML takes the following form:
According to the Javadoc, JComponent.repaint(long) is supposed to schedule a repaint() sometime in the
According to the javadoc, if I call receive() on a javax.jms.MessageConsumer it will block
How could that be that TransformerFactory.newInstance().newTransformer(streamSource) returns null. According to javadoc this is not
According to the javadoc: Replaces every subsequence of the input sequence that matches the
I use maven 3 and have my javadoc configured according to the new maven
According to javadoc , the '#' flag stands for The result should use a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.