Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
class pp
{
	public static void main(String[] args) throws IOException {
		

File newFile=new File("asdhjsadb.png");
		   byte[] fileData = new byte[ (int)newFile.length()];
	   InputStream inStream = new FileInputStream( newFile);	
	  inStream.read(fileData);		
	  inStream.close();
	  String tempFileData = new String(fileData);		
	  String imageString=new BASE64Encoder().encode(fileData);
	  

	}
}

in this above code error"BASE64Encoder cannot be resolved to a type" what i can i do for removing that error .
Posted
Updated 7-Oct-13 0:30am
v2
Comments
hansoctantan 7-Oct-13 6:09am    
I try your code and its working fine
baliram bhande 7-Oct-13 6:21am    
which jar file u have included to solve "BASE64Encoder()"
baliram bhande 7-Oct-13 9:13am    
i am working on final year project please tell me which package or which jar i will include in that code .please tell me thanks in advance
hansoctantan 8-Oct-13 4:31am    
I just copy your code and it works

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900