import java.io.*;

public class test {
    public static void main(String[] args) throws Exception {
        InputStream stream = new FileInputStream("C:\\file\\check.txt");;//load a text file that have new line chars on Windows OS

int inputChar = 0;

while((inputChar =stream.read()) >= 0)
{
    if(inputChar == '\n')
        System.out.println("This is a new line character with code: " + ((int) inputChar));
    else
        System.out.println("This is a character with code: " + ((int) inputChar));
}

stream.close();
    }
}