🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #16523

Re: How get length of file?

#16523
From: Richard Wilkman
Date: Tue, 09 Feb 1999 00:00
36 lines
1707 bytes
Marcel:

java.io.File.length() tells you the size of the file.  You can watch
the bytes go by in the stream.  The rest is just math.

-Rich

Marcel Hell wrote:
> 
> Hi, my problem is the following:
> I have an application reading a file byte by byte via an FileInputStream.
> The bytes read are immediately written to another via a FileOutputStream.
> This works fine so far, NOW:
> I want the user to be able to follow the progress of the read-write action,
> so I am planning to use a JProgressBar. And here is my problem, HOW can I
> detect the length of the input file in order to set the maximum value in the
> JProgressBar?
> Could anyone help??
> 
> Regards
> Marcel Hell

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team

If you see something that looks like an opinion up there,
it's mine and mine alone.

Mail sent to me from the newsgroups won't bounce but will
be ignored.  If I have time, I'll respond, but you  have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <36C0C4B0.4552A90F@inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <79q4do$6r01@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,c068c1d8bba70eeb
X-Google-Attributes: gidf74b3,public
From: Richard Wilkman <rwilkman@inprise.com>
Subject: Re: How get length of file?
Date: 1999/02/09
Message-ID: <36C0C4B0.4552A90F@inprise.com>
X-Deja-AN: 442602743
Content-Transfer-Encoding: 7bit
References: <79q4do$6r01@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language