I have Base64 content of an xml file.I want to decode that and save the content of file to a string rather than saving in external file. Can anyone suggest this. Please see the following thing
Base64 Encoded Format
PD94bUeXBlPmVJQSBjaGFuZ2VzPC9GaWxlVHlwZT4NCiAgICA8RmlsZURhdGU+=
File Content
<DATA>
<Table>
<LotNo>50700022611201413280</LotNo>
<FileFrom>CAMS Repository Services Limited</FileFrom>
<NoOfRec>2</NoOfRec>
<FileType>eIA partial</FileType>
<FileDate>26/11/2014 13:28:02</FileDate>
<FileFromCode>5</FileFromCode>
<FileToCode>7</FileToCode>
<FileTypeCode>301</FileTypeCode>
</Table>
</Data>
I am using following code for this
String outFnm="PD94bUeXBlPmVJQSBjaGFuZ2VzPC9GaWxlVHlwZT4NCiAgICA8RmlsZURhdGU+=";
byte[] b1=outFnm.getBytes();
byte[] bFile=Base64.decodeBase64(b1);
//System.out.println(b1.toString());
//Integer bFile2=Integer.parseInt(bFile);
System.out.println(b1);
System.out.println(bFile.toString());
FileOutputStream fos = new FileOutputStream("D:/test.txt");
fos.write(bFile);
fos.close();
But I don't want to use a seperate file to store that. I want a string variable which stores the "test.txt" contents.