I specify these file address data/data/org.com.Cache/files/cacheImplementationOutput but I got the following error message…..
java.io.IOException: Couldn't open /data/data/org.com.Cache/files/cacheImplementationOutput
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
mention the method name as fetch(url, outputXml);
and read the xml content as….
FileInputStream fis = openFileInput(outputXml);
public byte[] readBytes(InputStream inputStream, String outputXml) {
try {
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
OutputStreamWriter fout = new OutputStreamWriter(openFileOutput(
outputXml,0));
int len = 0;
while ((len = inputStream.read(buffer)) != -1) {
byteBuffer.write(buffer, 0, len);
}
fout.write(new String (byteBuffer.toByteArray()));
fout.close();
return byteBuffer.toByteArray();
}catch (NullPointerException e) {
e.printStackTrace();
}
catch (Exception e) {
}
return null;