code异常处理

private void copyPrivateRawResuorceToPubliclyAccessibleFile() {
InputStream inputStream = null;
FileOutputStream outputStream = null;
try {
XX
/*异常处理*/
try {
while ((length = inputStream.read(buffer)) > 0){
outputStream.write(buffer, 0, length);
}
} catch (IOException ioe) {
/* ignore */
}
} catch (FileNotFoundException fnfe) {
/* ignore */
} finally {
/*异常处理*/
try {
if (inputStream != null)
inputStream.close();
} catch (IOException ioe) {
/* ignore */
}
/*异常处理*/
try {
if (outputStream != null)
outputStream.close();
} catch (IOException ioe) {
/* ignore */
}
}
}

 

posted @ 2016-09-23 10:08  小毛驴  阅读(406)  评论(0编辑  收藏  举报