2 // FilterFileReader.java
5 // Created by Lutz Mueller on 7/17/07.
7 import java
.awt
.event
.*;
9 import java
.io
.InputStreamReader
;
10 // import java.io.FileReader;
11 import java
.io
.FileInputStream
;
14 public class FilterFileReader
extends InputStreamReader
{
16 public FilterFileReader(String path
, String charSet
) throws java
.io
.FileNotFoundException
, UnsupportedEncodingException
18 super(new FileInputStream(path
), charSet
);
21 public FilterFileReader(String path
) throws java
.io
.FileNotFoundException
, UnsupportedEncodingException
23 super(new FileInputStream(path
));
27 public class FilterFileReader extends FileReader {
29 public FilterFileReader(String path) throws java.io.FileNotFoundException
35 public int read() throws java
.io
.IOException
37 int chr
= super.read();
45 public int read(char[] cbuf
, int offset
, int length
) throws IOException
50 //System.out.println("reading:" + offset + " " + length);
52 for(int i
= 0; i
< length
; i
++)
61 cbuf
[offset
+ i
] = (char)chr
;
65 if(len
== 0) return(-1);