|
|
Java I/0 Examples

- What is Java I/O?
The Java I/O means Java Input/Output. It is provided by the java.io
package. This package has an InputStream and OutputStream. Java InputStream is
defined for reading the stream, byte stream and array of byte stream.
- Classes and Interfaces of the I/O Streams
The following listing of classes provided by the
java.io
package shown in the given table.
- Reading Text from
the Standard Input
Java provides the standard I/O facilities for reading text through
either from the file or from the keyboard on command line. This program illustrates how to use standard input to read the user input.
- Working With
the Files
The File class deals with the
machine dependent files in a machine-independent manner i.e. it is easier to write
platform-independent code that examines and manipulates files using the File
class. This class is available in the java.lang
package.
- Copying a File to Another
File
- Copying Multiple Files
- Moving a
File or Directory to Another Directory
- Deleting
a File or Directory
- Change a File timestamp
- Create a Temp File
- Delete a Temp File
- Getting an absolute path
and Parents of a Filename
- Working with a Directory
In the section, you will learn
how a directory is created. Apart from this, you will also be aware
from some manipulations that are performed
on a directory.
-
Traversing files and directories
- Getting the Current Working Directory
- Getting the Modification Time of a File or Directory
- Listing Files or
Subdirectories
- Deleting a File
- Filter I/O Streams
Like I/O streams, Filter streams
are also used to
manipulate the data reading from an underlying stream.. Apart from this,
it allows the user to make a chain using
multiple input stream so that, the operations that are to be applied
on this chain, may create a combine effects on
several filters.
- Overview of I/O Data Streams
Data streams are filtered streams that perform binary
I/O operation on primitive data type values ( boolean, char, byte, short, int,
long, etc.) as well as on String values. If
you need to work with data that is not represented as bytes or characters then
you can use Data Streams.
- Using a Random Access
File
n this section, you will learn about the Random Access File
class
provided by java. io package. This is a class that allows you to read
and write arbitrary bytes, text, and primitive Java data types from or
to any specified location in a file.
- Converting
a Filename Path to a URL
In this section, you will learn, how a Filename
path is converted to a URL and vice versa . URL stands for Uniform
Resource Locator.
- Making Tokens of a Java Source Code
In Java, The StreamTokenizer class is used for simple
parsing of a Java source file into tokens. This class takes an input
stream, breaks up the ASCII text in a file and parses it into
"tokens". It allows the tokens to be read one at a time.
- Introduction to Encoding
Java programs use Unicode text internally.
It supports standard UTF-8 when reading and writing strings
through the InputStreamReader and the OutputStreamWriter.
- Serializing
an Object
Serialization is the process of saving an object in a storage
medium (such as a file, or a memory buffer) or to transmit it over a
network connection in binary form.
- Deserializing an
Object
The opposite operation of the serialization is called deserialization
i.e. to extracting the data from a series of bytes is s known as deserialization
- Delete file or Directory
In this example we are discussing the deletion of a
file or a directory by using a java program. We pass the file name or the
directory name to which we want to delete.
- Downloading and Viewing html source of a page i.e. running on the
server
This section illustrates you the procedure of viewing
complete html code of a page i.e. running on the server.
-
Miscellaneous

|
|
Facing Programming Problem?
|
| Add This
Tutorial To: |
Del.icio.us |
Digg |
Google |
Spurl |
Blink |
Furl |
Simpy |
Y! MyWeb |
|
|
Current Comments
2 comments so far (post your own) View All Comments Latest 10 Comments:i know how count a word in java.its using length function.... but i don't know how to count without blank spaces.... plz help me with sample code....
Thank U
Arthi
Posted by arthi on Monday, 12.3.07 @ 16:09pm | #41180
very good .
i never seen that type of explanation.
Posted by anil pinninti on Wednesday, 11.14.07 @ 17:29pm | #37377