Revert "Close FileChannels in UpdateHandler#copyFile." am: 4b46e71163

am: e1a9d7ae67

* commit 'e1a9d7ae6715fba1da71d536013e48b9b7e6f9f0':
  Revert "Close FileChannels in UpdateHandler#copyFile."
main
Yohei Yukawa 2016-03-04 00:03:44 +00:00 committed by android-build-merger
commit 67ab868b93
1 changed files with 2 additions and 10 deletions

View File

@ -689,16 +689,8 @@ public final class UpdateHandler {
} else {
try {
final FileChannel sourceChannel = ((FileInputStream) in).getChannel();
try {
final FileChannel destinationChannel = ((FileOutputStream) out).getChannel();
try {
sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel);
} finally {
destinationChannel.close();
}
} finally {
sourceChannel.close();
}
final FileChannel destinationChannel = ((FileOutputStream) out).getChannel();
sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel);
} catch (IOException e) {
// Can't work with channels, or something went wrong. Copy by hand.
DebugLogUtils.l("Won't work");