🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #991

Re: OutOfMemoryError

#991
From: Alan Shiers
Date: Wed, 03 Jul 2002 02:33
30 lines
2037 bytes
Hi guys,

I've been busy trying to implement the new code and I'm having a problem
with the conditional statement of the while loop.

myFile = new File("C:\somepath\somefile");
if(myFile.exists())System.out.println("file exists");
FileIn = new FileInputStream(myFile);

byte[] buffer = new byte[128];
int n;
while((n = FileIn.read(buffer)) >= 0)  << Problem line
{
    rq.output.write(buffer);
}

The FileIn object is a FileInputStream object and everytime at runtime I
get an IOException stating that it has a "Bad file descriptor".  I don't
understand what it is telling me or how to fix it.

Earlier, I had created a File object using an absolute file path and
file name. Even tested it with the File.exists() method, which returned
true, and used the File object as an arguement for the FileInputStream
object, like so: FileIn = new FileInputStream(myFile);

What is causing this "Bad file descriptor" thing?

Please advise,

Alan
Technical Details
Message-ID: <3D226288.1C7C905@hfx.eastlink.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-08!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,28eab50e784856ac
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-07-02 18:35:44 PST
Message-ID: <3D226288.1C7C905@hfx.eastlink.ca>
Date: Tue, 02 Jul 2002 22:33:44 -0400
From: Alan Shiers <ashiers@hfx.eastlink.ca>
Organization: Mustard Seed Software
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: OutOfMemoryError
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.222.101.2
X-Trace: dnews 1025659864 24.222.101.2 (2 Jul 2002 18:31:04 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-08!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews