Article View: pl.comp.lang.java
Article #457Odczyt pliku w Javie
From: Radoslaw Poplawski
Date: Wed, 02 Apr 1997 11:38
Date: Wed, 02 Apr 1997 11:38
34 lines
1558 bytes
1558 bytes
public static boolean Czytaj(String Plik)
{
try {
File PlikWej = new File(Plik);
FileInputStream strwej = new FileInputStream(PlikWej);
int status;
byte plik[] = new byte[20000]; //na wczytywany plik
status = strwej.read(plik[]);
itd..... }
Czy ktos moze powiedziec dlaczego kompilator krzyczy na linii: "status
= strwej.read(plik[]);"??? Odpowiednie FileInputStream.read zaczyna
sie od:
--
public int read(byte b[]) throws IOException
Reads up to b.length bytes of data from this input stream into an
array of bytes. This method blocks until some input is available.
Parameters:
b- the buffer into which the data is read
Returns:
the total number of bytes read into the buffer, or -1 is there is no
more data because the end of the file has been reached.
--
wiec wszystko chyba jest w porzadku, a kompilator krzyczy "missing
array dimension".
Radoslaw Poplawski (Wroclaw) http://yi.com/home/PoplawskiRadoslaw/
MotorCity: http://www.geocities.com/MotorCity/3416/
F1: http://www.geocities.com/MotorCity/3416/f1.html
Technical Details
Message-ID:
<33423e56.3340080@news.icm.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!not-for-mail From: radekp@usa.net (Radoslaw Poplawski) Newsgroups: pl.comp.lang.java Subject: Odczyt pliku w Javie Date: Wed, 02 Apr 1997 11:38:31 GMT Organization: ICM Lines: 34 Message-ID: <33423e56.3340080@news.icm.edu.pl> NNTP-Posting-Host: ppp-cen39.wroclaw.tpnet.pl Mime-Version: 1.0 X-Newsreader: Forte Agent .99g/32.339 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit