Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Example Java Io Java I/O Examples

Related Tutorials


 
 

Share on Google+Share on Google+

Java I/O Examples

Advertisement
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.

Java I/0 Examples

     

  1. 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.
  2. Classes and Interfaces of the I/O Streams
    The following listing of classes provided by the java.io package shown in the given table.
     
  3. 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.
  4. 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.

  5. 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.

  6. 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. 
  7. 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.
  8. 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. 

     
  9. 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.
        
  10. 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.
      
  11. 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.
  12.  
  13. 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.
      
  14. 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
        
  15. 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.
       
  16. 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.
     
  17. URL file Download and Save in the Local Directory
    This Program file download  from  URL and save this Url File in the specified directory. This program specifies the directory path where the files to be stored  as first command line argument and second command line arguments specifies URL File to be stored.
      
  18. Create XML file from flat file and data insert into database
    In this section, we have developed an application to create xml file from flat file and data insert  into database in Java. 
      
  19. Miscellaneous 

  20. Delete File Example
    In this section, you will learn how to delete a file.
     
  21. Buffer Reader
    In this section you will learn how to read line by line data from a file using BufferedReader.
     
  22. File Input Stream
    Java has Two types of streams- Byte & Characters.
     
  23. File Output Stream
    As we discussed earlier, java has two kinds of streams- Byte & Characters.
     
  24. Last Modified Date
    This section contains the detail about how to get the last modification date of a file.
     
  25. Java File Handling
    For file handling in java, the package known as java.io is available.
     
  26. File Compare
    In this section, we will discuss how to compare pathname of two file for the equality of their path.
     
  27. Read File Buffered Writer Example
    In this section, you will learn how to write to a file using BufferedWriter.
     
  28. Copy File Example
    In this section, you will learn how to copy content of one file into another file.
     
  29. File Handling In Java
    In this section we will discussed about How files can be handled in Java.
  30. Java I/O Byte Streams
    In this section we will discussed the I/O Byte Streams.
  31. Java I/O Character Streams
    In this section we will discuss the I/O Character Streams.
  32. Java I/O Buffered Streams
    In this section we will discuss the I/O Buffered Streams.
  33. Java I/O Data Streams
    In this tutorial we will discuss the Java I/O Data Streams.
  34. Java I/O Object Streams
    In this section we will discuss the Java IO Object Streams.
  35. Scanning and Formatting in Java
    In this we will discuss about the Java I/O Scanning and Formatting.
  36. Java I/O From the Command Line
    In this section we will learn about the I/O from the command line in Java.
  37. Java IO Path
    In this section we will discuss about the Java IO Path.
  38. Java Path Class
    In this section we will discuss all the aspect of Path class of Java.
  39. Java IO InputStream Example
    In this section we will discuss about the InputStream in Java.
  40. Java Byte Streams Example
    In this section we will discuss how to read one byte at a time from the input stream.
  41. Java IO SequenceInputStream Example
    In this tutorial we will learn about the SequenceInputStream class.
  42. Java FileInputStream
    In this section we will discuss about the Java IO FileInputStream.
  43. Java PipedInputStream
    In this example we will discuss about the Java PipedInputStream.
  44. Java ObjectInputStream
    In this example we will discuss about the Java class ObjectInputStream.
  45. Java FilterInputStream Example
    In this tutorial we will discuss about the FilterInputStream class in Java.
  46. Java IO OutputStream
    In this section we will read about the OutputStream class of java.io package.
  47. Java FileOutputStream Example
    In this section we will discuss about the Java IO FileOutputStream.
  48. Java ByteArrayOutputStream Example
    In this section we will discuss about the Java IO Byte Streams ByteArrayOutputStream class.
  49. Java PipedOutputStream
    In this tutorial we will discuss about the Java PipedOutputStream.
  50. Java PipedInputStream and PipedOutputStream
    In this section we will discuss about the PipedInputStream and PipedOutputStream in Java.
  51. Java ObjectOutputStream
    In this tutorial we will discuss about the Java class ObjectOutputStream.
  52. Java ObjectOutputStream ObjectInputStream
    In this section we will discuss about the ObjectOutputStream and ObjectInputStream in Java.
  53. Java FilterOutputStream Example
    In this section we will discuss about the FilterOutputStream class in Java.
  54. Java IO Reader
    In this section we will discuss about the Reader class in Java.
  55. Java IO FileReader
    In this tutorial we will learn about the FileReader class in Java.
  56. Java IO BufferedReader
    In this section we will discuss about the BufferedReader class in Java.
  57. Java IO CharArrayReader
    In this tutorial we will learn about the CharArrayReader class in Java.
  58. Java IO FilterReader
    In this section we will learn about the FilterReader class in Java.
  59. Java IO StringReader
    In this section we will discuss about the StringReader class in Java.
  60. Java IO InputStreamReader
    In this section we will discuss about the InputStreamReader in Java.
  61. Java IO PipedReader
    In this section we will discuss about the PipedReader in Java.
  62. Java IO LineNumberReader
    In this tutorial we will learn about the LineNumberReader in Java.
  63. Java PushbackReader
    In this section we will discuss about the PushbackReader class in Java.
  64. Java IO Writer
    In this section we will discuss about the Writer class in Java.
  65. Java IO BufferedWriter
    In this section we will discuss about the BufferedWriter class in Java.
  66. Java IO CharArrayWriter
    In this tutorial we will learn about the CharArrayWriter in Java.
  67. Java IO FilterWriter
    In this example we will discuss about the FilterWriter in Java.
  68. Java IO OutputStreamWriter
    In this section we will learn about the Java OutputStreamWriter.
  69. Java IO PipedWriter
    In this tutorial we will learn about the PipedWriter in Java.
  70. Java IO PrintWriter
    In this tutorial we will learn about the the PrintWriter class in Java.
  71. Java IO StringWriter
    In this section we will discussed about the StringWriter in Java.
  72. Command Line Standard Input In Java
    In this section we will discuss about the Java IO Standard Input through Command Line.
  73. Command Line Standard Output In Java
    In this section we will discuss about the Command Line Java IO Standard Output.
  74. Command Line Standard Error In Java
    In this section we will discuss about the Command Line Java IO Standard Error.
  75. How To Read String From Command Line In Java
    In this section we will discuss about how string can be read through the command line.
  76. How To Read Integer From Command Line In Java
    In this section we will discuss about how an integer can be read through the command line.
  77. Java IO File
    In this section we will discuss about the File class in Java.
  78. How To Create a New File
    In this section we will discuss about how to create a new file in Java.
  79. How To Read File In Java
    In this section we will discuss about about how data of a file can be read in Java.
  80. Java Construct File Path
    In this section we will discuss about how to construct file path in Java.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 2, 2008

Related Tutorials

Discuss: Java I/0 Examples   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:11
rashmi rani
August 20, 2011
java

java aii programing(question with ans)
manoj nainwal
August 26, 2011
about boolean variable ...

any one plz tell me about the boolean variable in java... howz it work in computer if its numeric representation is not present , becozz our computer just process 0 & 1 ... and also how much space are allocated when we initializes a boolean variable........??????
???
December 12, 2011
www.yybook.org

good job
sethuraman
March 23, 2012
i like this web site

very useful of this notes
ali baba
June 16, 2012
my name is ali baba

no comments...do you have??? ;-) :D
santosh
August 2, 2012
searching file using java

import java.io.File; import java.util.Scanner; public class FileExists { public static void main(String[] s) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the url of a file: "); System.out.flush(); String filename = scanner.nextLine(); File file = new File(filename); if(file.exists()){System.out.println("exists");} else{System.out.println("not exists");} } } output1: Enter the url of a file: C:\Users\298564\Desktop\sa.txt exists output2: Enter the url of a file: C:\Users\298564\Desktop\asdfs.txt not exists
navinaar
September 5, 2012
miracle ma :D

wow;)
RAM33
October 1, 2012
getting a input

what are different ways in java to get inputs and the most simplest way?
Rajyalaxmi
December 3, 2012
java.io package

We have Scanner class in io then what is the need of Console class?
DMCA.com