Article View: borland.public.jbuilder.java.language
Article #15919BufferdInputStream, how they work?
From: Jason C. Leach
Date: Thu, 15 Apr 1999 00:00
Date: Thu, 15 Apr 1999 00:00
39 lines
1567 bytes
1567 bytes
hi,
My applet is almost done. By last step is to buffer the IO to make it a
little snappier. So this is what I did was:
FileInputStream fin = new FileInputStream(iFile);
same for output stream.
now what I do is:
BufferdInputStream bfin = new BufferdInputStream(new
FileInputStream(iFile));
BufferdOutputStream bfout = new BufferdOutputStream(new
FileOutputStream(oFile));
I seem to be having trouble with my output file being a little smaller.
Where as with the FileInputStream they would match.
To read in a byte of data I: bfin.read(tmp); //where tmp is an int.
To read in the next byte I: bfin.read(tmp2);
and so on right? Only every 512 bytes, it goes and fetches more from the
file (as needed).
What I do is read in some data, compair the data byte by byte, and based
on that write the data or not.
Can anyone help sort me out?
Thanks,
j
--
�,+���+,��,+���+,�*
....Jason C. Leach
..."Many Hands Make Light Work."
..- Unknown
-- PGP key on server: pgpkeys.mit.edu
Technical Details
Message-ID:
<37166AE3.8D3FA85C@hotmail.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,5398bd6854fe923e,start X-Google-Attributes: gidf74b3,public From: "Jason C. Leach" <leachjc@hotmail.com> Subject: BufferdInputStream, how they work? Date: 1999/04/15 Message-ID: <37166AE3.8D3FA85C@hotmail.com> X-Deja-AN: 466897246 Content-Transfer-Encoding: 8bit X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language