edi02
asked on
Read a short text file into byte array
How to read a short text file (like "Hello World") in byte array?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, I was missing import java.io.*;
It works now
It works now
ASKER
C:\My Books\Java examples>javac Reader.java
Reader.java:5: cannot resolve symbol
symbol : class FileInputStream
location: class Reader
FileInputStream fip = new FileInputStream(new File("abc.txt"));
^
Reader.java:5: cannot resolve symbol
symbol : class FileInputStream
location: class Reader
FileInputStream fip = new FileInputStream(new File("abc.txt"));
^
Reader.java:5: cannot resolve symbol
symbol : class File
location: class Reader
FileInputStream fip = new FileInputStream(new File("abc.txt"));
^
Reader.java:23: cannot resolve symbol
symbol : class FileNotFoundException
location: class Reader
} catch (FileNotFoundException e) {
^
Reader.java:26: cannot resolve symbol
symbol : class IOException
location: class Reader
} catch (IOException e) {
^
5 errors