package innovimax.mixthem.io;

import innovimax.mixthem.interfaces.IInputChar;

import java.io.File;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.IOException;

/*
    Created by innovimax
    Default implementation of IInputChar
*/
public class DefaultCharReader implements IInputChar {

	private BufferedReader reader = null;	

	public DefaultCharReader(File input) throws IOException {		
		this.reader = new BufferedReader(new InputStreamReader(new FileInputStream(input)));
	}

	@Override
	public boolean hasCharacter() throws IOException {
		return reader.ready();
	}

	@Override
	public int nextCharacter() throws IOException {
		return this.reader.read();		
	}

	@Override
	public int nextCharacters(char[] buffer, int len) throws IOException {
		return this.reader.read(buffer, 0, len);		
	}

	@Override
	public void close() throws IOException {
		this.reader.close();
	}

}

@@ -148,55 +148,16 @@
 File
-InputStream;%0Aimport java.io.InputStream
 Reader;%0A
 impo
@@ -144,32 +144,32 @@
 .io.FileReader;%0A
+
 import java.io.I
@@ -318,16 +318,22 @@
 private 
+final 
 Buffered
@@ -349,15 +349,8 @@
 ader
- = null
 ;%09%0A%0A
@@ -453,53 +453,26 @@
 new 
-InputStreamReader(new FileInputStream
+FileReader
 (input))
 );%0A%09
@@ -467,17 +467,16 @@
 (input))
-)
 ;%0A%09%7D%0A%0A%09@
@@ -528,32 +528,32 @@
 s IOException %7B%0A
-
 %09%09return reader.
@@ -545,16 +545,21 @@
 %09return 
+this.
 reader.r

make reader final, use this., use FileReader