Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hello String Convert into base64encoder  RSS feed

 
Preethi jaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to change "Hello" string in to base64Encoder in java. without using Array. java provide any class for this.

Please give me any samples.

[ August 21, 2008: Message edited by: Preethi jaya ]
[ August 21, 2008: Message edited by: Preethi jaya ]
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refrain from using the word urgent next time. It's very unlikely that you'll get a quick reply by doing so, especially here.

Anyway, you can download commons-codec from Apache.
http://commons.apache.org/codec/

Base64.encodeBase64("Hello".getBytes());
 
Preethi jaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Freddy Wong! But i want to print the value How.
i want to view the encode value.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you not want to use arrays? That sounds a bit like "I want to code this without using loops". The code will use arrays anyway under the hood, whether the code you write does or not.

Anyway, you can use it without explicit array references somewhat like this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!