exception when running decoding program
i have a code to decode a string as follows:
public static void main(String[] args) throws IOException {
String base64="anybase64value"
byte[] bytes = Base64.decodeBase64(base64);
String tempDir = System.getProperty("java.io.tmpdir");
System.out.println(System.getProperty("java.io.tmpdir"));
String testFileName = "/tmp/" + "base64.xlsx";
FileOutputStream fos = new FileOutputStream(new File(testFileName));
IOUtils.write(bytes, fos);
System.out.println("Wrote " + bytes.length + " bytes to: " +
testFileName);
}
but when i run it throws me an error : The method write(byte[],
OutputStream) in the type IOUtils is not applicable for the arguments
(byte[], File) The method close() is undefined for the type File
No comments:
Post a Comment