hi, I'm getting java.lang.NullPointerException
at while ((len = in.read(buf , 0 , buf.length)) >= 0)
in following method:
public void copy(String src, File dst) throws IOException {
InputStream in = getClass().getResourceAsStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1012];
int len;
while ((len = in.read(buf , 0 , buf.length)) >= 0) {
out.write(buf, 0, len);
buf = null;
}
in.close();
out.close();
}
I'm not getting the coz.I will be thankful if I get the solution.thanks in advance.......