-1

In the code below, imageInByte is a byte array. I'm receiving the following error:

encodeBase64() is undefined for class rsa1

import org.apache.commons.codec.binary.Base64;

public class rsa1 { 
    public static void main(String args[]) {
        byte[] bigByteArray=new byte[1796];
        for (int i=0;i<4;i++)
            bigByteArray[i]=imageInByte[i];
        for (int i=4;i<=1795;i++)
            bigByteArray[i]=cipherData[i-4];
        byte[] bigByteArray1 = Base64.encodeBase64(bigByteArray);
    }
MByD
  • 135,866
  • 28
  • 264
  • 277
shree
  • 125
  • 1
  • 4
  • 15
  • Have you included the `commons-codec-1.6.jar` library in your classpath? – mellamokb Mar 27 '12 at 22:40
  • 1
    This appears to be a compiler error, not one during runtime. Where's your second `}`? – MrGomez Mar 27 '12 at 22:41
  • @mellamokb I have downloaded commons-codec-1.5.jar and included in class path.I am using Eclipse IDE – shree Mar 27 '12 at 22:42
  • 1
    is this a homework question? Aside from the missing declarations for imageInByte and cipherData and a missing closing '}' I see nothing wrong with this code (although you might want to consider using upper camel case for the name of your class) – smooth reggae Mar 27 '12 at 22:43
  • @smoothreggae that was the only case .thanks all of u!! – shree Mar 27 '12 at 22:48

0 Answers0