There is a great news for developers who use Eclipse – version Galileo SR2 is available for download from eclipse.org.
If you don’t want to download the full packages, you can start an upgrade – that’s what I did just a few minutes ago (Help -> Check . . . → Read More: Eclipse Galileo SR2 is available
I am going to show example which shows how to write a file in Java.
If you want to write some file you should start with FileOutputStream. This class is a concrete subclass of OutputStream.
Example:
I am going to show example which shows how to read a file in Java.
If you want to read some file you should start with FileInputStream. This class is a concrete subclass of InputStream. It provides an input stream connected to a particular file.
Example:
If you are working with file-system in Java, you should understand that your program can run in other types of OS:(Windows, Unix, Linux).
These OS has own file-system structure. For example you need to read or write file in Windows, which located at disk C:\, you should write:
is the abstract super class for all input streams. It declares the three basic methods needed to read bytes of data from a stream. It also has methods for closing streams, checking how many bytes of data are available to be read, skipping over input, marking a position in a stream and resetting back to that position, and determining whether marking and resetting are supported. Continue reading Using InputStream in Java
Recent Comments