HADOOP-10365. BufferedOutputStream in FileUtil#unpackEntries() should be closed in finally block. Contributed by Kiran Kumar M R and Sanghyun Yun.
This commit is contained in:
parent
2e251a7674
commit
dd149adeac
|
@ -1123,6 +1123,9 @@ Release 2.7.2 - UNRELEASED
|
||||||
HADOOP-12359. hadoop fs -getmerge doc is wrong.
|
HADOOP-12359. hadoop fs -getmerge doc is wrong.
|
||||||
(Jagadesh Kiran N via aajisaka)
|
(Jagadesh Kiran N via aajisaka)
|
||||||
|
|
||||||
|
HADOOP-10365. BufferedOutputStream in FileUtil#unpackEntries() should be
|
||||||
|
closed in finally block. (Kiran Kumar M R and Sanghyun Yun via ozawa)
|
||||||
|
|
||||||
Release 2.7.1 - 2015-07-06
|
Release 2.7.1 - 2015-07-06
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -742,15 +742,15 @@ public class FileUtil {
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
byte data[] = new byte[2048];
|
byte data[] = new byte[2048];
|
||||||
BufferedOutputStream outputStream = new BufferedOutputStream(
|
try (BufferedOutputStream outputStream = new BufferedOutputStream(
|
||||||
new FileOutputStream(outputFile));
|
new FileOutputStream(outputFile));) {
|
||||||
|
|
||||||
while ((count = tis.read(data)) != -1) {
|
while ((count = tis.read(data)) != -1) {
|
||||||
outputStream.write(data, 0, count);
|
outputStream.write(data, 0, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue