Questions tagged [apache-commons-codec]

Apache Commons Codec provides implementations of common encoders and decoders such as Base64, Hex, Phonetic and URLs.

Apache Commons Codec was originally designed to be the definitive Base64 encoder, as there existed many different implementations.

While this package contains an abstract framework for the creation of encoders and decoders, Codec itself is primarily focused on providing functional utilities for working with common encodings.

http://commons.apache.org/proper/commons-codec/

63 questions
3
votes
1 answer

Android: gradle exclude commons-codec

In my android project I need commons-codec 1.8 and I would like to exclude the built-in commons-codec version. I also have some maven dependencies and I want them use 1.8 instead of built-in. Here is the error message, it looks like the built in jar…
3
votes
1 answer

Difference between BouncyCastle and Apache Commons Codec Base64 encoding

I would like to find out if the Base64 encoding mechanism provided by BouncyCastle and the equivalent mechanism providing by Apache Commons Codec are totally compatible, or if there could be compatibility problems. I am working on a library in Java…
user3441604
  • 582
  • 7
  • 23
3
votes
2 answers

Base64.decode(privateKeyString, Base64.DEFAULT) in Commons Codec

Using Android's Base64, it's possible to do this: Base64.decode(privateKeyString, Base64.DEFAULT). If you are using Apache's Commons Codec, this isn't available. How can I achieve the same result using Commons Codec?
Sandah Aung
  • 6,156
  • 15
  • 56
  • 98
2
votes
1 answer

Is MacOS Catalina stripping executable file permissions in zip files?

I have created a zip file using OpenJDK 11 and Apache Commons Compress 1.20 which is returned by an API using a Netty server. This zip file contains a gradle wrapper that has executable file permissions (755). -rwxr-xr-x 1 myuser mygroup 5766 Aug…
BunnyRabbit
  • 347
  • 1
  • 2
  • 12
2
votes
1 answer

Android v1p1beta1 Speech - java.lang.NoSuchMethodError: No static method decodeBase64

When I build test speech app with Android Studio using google v1 speech library it works fine. Using v1p1beta1 speech library, a run time error occurs when it accesses the json credentials file and legacy commons codec and generates the following…
2
votes
2 answers

Can't get Base64.decodeBase64 to work (Commons codec)

String encode = Base64.encodeBase64String("Hello".getBytes()); System.out.println(encode); byte[] decode = Base64.decodeBase64(encode); System.out.println(decode.toString()); I can't tell whats wrong here. I've tried every possible combination…
Drew H
  • 4,699
  • 9
  • 57
  • 90
2
votes
2 answers

Base64 apache.commons .encodeBase64 symbol not found

I am working on writing an encryption class to encrypt/decrypt data with a key before/after sending TCP data. I am having a problem getting org.apache.commons.codec.binary.Base64 to work on my system. In most cases, I can see people relating this…
Chemistpp
  • 2,006
  • 2
  • 28
  • 48
2
votes
1 answer

commons http client - kerberos token while negotiating has \r\n (carriage return line feed) characters

I am trying to use jakarta commons http client. Doing kerberos authentication to communicate with a server. Authentication always fails. On digging deeper I found out that the kerberos token header has carriage return line feed characters in it…
aseem
  • 800
  • 1
  • 9
  • 13
2
votes
1 answer

why method Base64.encodeBase64String(byte) is not available

Hello I have included in my project build path apache commond codec 1.7 .jar from the official web page but the method Base64.encodeBase64String(byte is not available when I write my code. I have tested with older versions of the jar (1.5, 1.6)…
Tania Marinova
  • 1,788
  • 8
  • 39
  • 67
2
votes
2 answers

Apache Cordova: can't get commons-codec

I am trying to create a new Android project with Apache Cordova. The script starts but fails with the message: Could not retrieve the commons-codec. Please download it yourself and put it in the framework\libs directory. This process may fail…
A. Steenbergen
  • 3,360
  • 4
  • 34
  • 51
1
vote
0 answers

How to use java.util.Base64 instead of Base64OutputSteam to decode a stream of characters to byte array?

I'm currently using a stream based approach to convert incoming Base64 characters to a byte[] using the Apache commons-codec class org.apache.commons.codec.binary.Base64OutputStream. import java.io.ByteArrayOutputStream; import…
Danny
  • 11
  • 3
1
vote
1 answer

Base64 cannot be resolved (Java 1.7)

I have the following snippet and I have some unresolved classes - mainly, Base64 String auth = username + ":" + password; byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1)); String authHeader = "Basic " + new…
Martyn
  • 6,031
  • 12
  • 55
  • 121
1
vote
0 answers

How to get two-sequence representation of UTF-8 character using JavaMail's MimeUtility or Apache Commons and quoted-printable?

I'm having a string which contains the German ü character. Its UTF value is 0xFC, but its quoted-printable sequence should actually be =C3=BC instead of =FC. However, using JavaMail's MimeUtility like below, I can only get the single-sequence…
1
vote
1 answer

java.lang.NoMethodError : org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString

I am getting the following exception in my web application: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString([B)Ljava/lang/String; The commons-codec-1.5.jar…
adarsh hegde
  • 1,353
  • 2
  • 21
  • 43
1
vote
1 answer

Convert Image to base64 String in Java

I'm trying to convert an image file obtained from URL to Base64 String using apache.commons.codec jar file. Java code.. import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
Lucy
  • 1,812
  • 15
  • 55
  • 93