View All IO

View All IO


Advise for a fresher

Do not expect command on Java I/O Streams overnight. It is ocean, until and unless not properly approached, it leaves in a very great confusion, of course without pointers (feeling of when you lost alone in an unknown forest). It is a ocean due to number of classes, and these classes are given to make your programming easy (not to confuse you). I feel the following is a better way to penetrate into Java Input/Output Tutorial; follow the following order of reading.

    A) General Programs

  1. Java I/O Streams – Overview
  2. Byte streams and Character streams
  3. Byte streams vs Character streams
  4. Semantics of File Copying
  5. Performance drawbacks of file copying
  6. BufferedInputStream and BufferedOutputStream
  7. Chaining of Streams
  8. DataInputStream and DataOutputStream – File Copying
  9. Skipping a part of a File
  10. Keyboard Input (Scanf in Java)

  11. Keyboard Input – DataInputStream
  12. Keyboard Input – BufferedReader
  13. Keyboard Input – Scanner – No parsing
  14. Scanner – Checking for Tokens
  15. SequenceInputStream – Merging Files
  16. ByteArrayInputStream
  17. ByteArrayOutputStream
  18. StringBufferInputStream
  19. Using markSupported(), mark() & reset()
  20. PrintStream
  21. Filter Streams in java.io Package
  22. Giving Line Numbers – LineNumberInputStream
  23. File Copying – FileReader & FileWriter
  24. BufferedReader & BufferedWriter
  25. CharArrayWriter – Storing Data
  26. StringReader
  27. StringWriter – Storing Data
  28. CharArrayReader – Reading from Character Array
  29. PrintWriter – Formatting Data
  30. PushbackReader – Pushing out Character
  31. Using OutputStreamWriter
  32. RandomAccessFile – Reading Sequentially and Randomly
  33. LineNumberReader – Giving Line Numbers
  34. PipedInputStream and PipedOutputStream
  35. File class – Retrieving Metadata of File
  36. File class – Changing File Properties
  37. StreamTokenizer – Tokenizing a Stream
  38. Performance tips in file copying
    B) Compare and Contrast I/O classes. Important for Interviews.

  1. Byte streams vs Character streams
  2. PrintStream vs PrintWriter
  3. StringWriter vs StringBuilder
  4. StreamTokenizer vs StringTokenizer
    C) Miscellaneous increasing your programming skills.

  1. System.out.println()?
  2. What is System.in?
  3. Closeable and Flushable interfaces
  4. Number of Lines in a File
  5. Reading and writing arrays and strings
  6. Wrapper Streams
  7. Filter Streams
  8. Byte streams vs Character streams

4 thoughts on “View All IO

  1. samir

    //Here I post a nio charset program

    package com.sam.CharSet;

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.nio.charset.Charset;

    public class UnicodeToCharSet {

    public static void main(String[] args) throws IOException {

    Charset charset = Charset.forName(“utf-8”);

    InputStreamReader isr = null;
    isr = new InputStreamReader(new FileInputStream(new File(
    “FILE Path”)), charset);
    int i = 0;
    while ((i = isr.read()) != -1) {
    char c = (char) i;
    System.out.print(c);
    }
    isr.close();

    }

    }

  2. samir

    package com.sam.CharSet;

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.nio.charset.Charset;

    public class UnicodeToCharSet {

    public static void main(String[] args) throws IOException {

    Charset charset = Charset.forName(“utf-8”);

    InputStreamReader isr = null;
    isr = new InputStreamReader(new FileInputStream(new File(
    “FILE Path”)), charset);
    int i = 0;
    while ((i = isr.read()) != -1) {
    char c = (char) i;
    System.out.print(c);
    }
    isr.close();

    }

    }

  3. Nikunj Jani

    Hello Sir..

    I tried to find about NIO(New Input/Output) Package and all the things related to it on your blog but I couldn’t find anything. so my request is please post details about NIO. I jast want to know about it…so please sir Post all the details about it…!! officially it was introduced in java 1.7 version but actually it is from java 1.4 version.

Leave a Reply

Your email address will not be published. Required fields are marked *