Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 38839 Details for
Bug 137336
Request for update.core to avoid nio transferTo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for requested change
137336.patch (text/plain), 1.58 KB, created by
Phil Loats
on 2006-04-18 15:18:48 EDT
(
hide
)
Description:
patch for requested change
Filename:
MIME Type:
Creator:
Phil Loats
Created:
2006-04-18 15:18:48 EDT
Size:
1.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.update.core >Index: src/org/eclipse/update/internal/core/JarDeltaInstallHandler.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.update.core/src/org/eclipse/update/internal/core/JarDeltaInstallHandler.java,v >retrieving revision 1.1 >diff -u -r1.1 JarDeltaInstallHandler.java >--- src/org/eclipse/update/internal/core/JarDeltaInstallHandler.java 15 Nov 2005 06:01:07 -0000 1.1 >+++ src/org/eclipse/update/internal/core/JarDeltaInstallHandler.java 18 Apr 2006 19:06:24 -0000 >@@ -18,7 +18,6 @@ > import java.io.InputStream; > import java.net.URI; > import java.net.URISyntaxException; >-import java.nio.channels.FileChannel; > import java.util.Date; > import java.util.Enumeration; > import java.util.jar.JarFile; >@@ -91,12 +90,22 @@ > > newJarFile.createNewFile(); > >- FileChannel in = new FileInputStream(tempFile).getChannel(); >- FileChannel out = new FileOutputStream(newJarFile).getChannel(); >- in.transferTo( 0, in.size(), out); >- >- in.close(); >- out.close(); >+ FileInputStream in = null; >+ FileOutputStream out = null; >+ try { >+ in = new FileInputStream(tempFile); >+ out = new FileOutputStream(newJarFile); >+ byte[] buffer = new byte[4096]; >+ int len; >+ while ((len=in.read(buffer)) != -1) { >+ out.write(buffer, 0, len); >+ } >+ } finally { >+ if (in != null) >+ in.close(); >+ if (out != null) >+ out.close(); >+ } > } > > public static void addToJar(JarOutputStream jos, JarFile jf) throws IOException {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 137336
: 38839 |
39116
|
39119
|
39123