Article View: borland.public.jbuilder.java.api
Article #43Re: Copying File
From: Kevin Dean [TeamB]
Date: Sun, 13 Feb 2005 00:08
Date: Sun, 13 Feb 2005 00:08
29 lines
1768 bytes
1768 bytes
Ata Ebrahimi wrote: > I wrote codes below and 2 compiler error occured. > > why ? > > how do I close fileIn, FileOut ? > > and u know it's very slow , how do I make it faster ? The reason you can't close the files is that the close() method is a member of FileInputStream/FileOutputStream and your objects are of types DataInput/DataOutput, which do not support that method. A quick Google search for "java file copy" (minus the quotes) yields the following: http://www.rgagnon.com/javadetails/java-0064.html Study the code; there are some good techniques there for buffering file I/O. -- Kevin Dean [TeamB] Dolphin Data Development Ltd. http://www.datadevelopment.com/ Please see Borland's newsgroup guidelines at http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<xn0dyfaitpy2o9000-kdean@www.teamb.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<420e7d0f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1089d0,b6b3538f7a85c1a3,start
X-Google-Attributes: gid1089d0,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com>
Subject: Re: Copying File
Newsgroups: borland.public.jbuilder.java.api
References: <420e7d0f@newsgroups.borland.com>
Organization: Dolphin Data Development Ltd.
User-Agent: XanaNews/1.17.2.6
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Message-ID: <xn0dyfaitpy2o9000-kdean@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:0000007A
NNTP-Posting-Host: 24.57.153.235
Date: 12 Feb 2005 16:08:08 -0800
X-Trace: newsgroups.borland.com 1108253288 24.57.153.235 (12 Feb 2005 16:08:08 -0800)
Lines: 29
X-Authenticated-User: kdean
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail