I have tried using the below code which generates a base64 for the file and returns as string. I was able to get if the file size is small.
StringBuffer output = new StringBuffer();
Process p;
try {
p = Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader =
new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}
return output.toString();
If there is any other way to get the base64 of the file.The command I am passing is base64 filename. please let me know