Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

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

        int i = 0;

        InputStream is = new FileInputStream("C://test.txt");
        FilterInputStream fis = new BufferedInputStream(is);

        while ((i = fis.read()) != -1) {
            char c = (char) i;

            System.out.print("Read: " + c);

            int j = fis.available();

            System.out.println("; Available bytes: " + j);
        }
    }
}