**** Errors
Hey all, ive had some great advice here before so heres hoping for a repeat. I have been given the task of creating a program that will use run length encoding to compress a String. Im sooo close of completeing it im sure!!! Anyway my code is below and i just can see why i am getting an error on line 6 saying "; expected". i have checked my brackets and semicolons and im sure they all work out. Can any spot why this code is all so wrong?
import java.io.*;
class JavaApplication14
{
publicstaticvoid RunLengthEncoding()throws IO Exception{
try{
File inputFile =new File("demo.txt");
File outputFile =new File("demo" +"rl");
FileInputStream fileInputStream =new FileInputStream(inputFile);
FileOutputStream fileOutputStream =new FileOutputStream(outputFile);
}
catch(IOException e){
System.out.println("Cannot Open File");
}
//}
//{
//System.out.println(e.getMessage());
//}
}
publicinterface Processor{
void process(Token t);
}
publicclass Token{
privatechar chr;
privateint count;
public Token(char chr,int count){
this.chr= chr;
this.count= count;
}
}
// getters
publicchar getChar(){
return chr;
}
publicint getCount(){
return count;
}
publicclass Encoder{
private Reader reader;
private Processor processor;
// ctor
public Encoder(InputStream fileInputStream, Processor processor){
this.reader=new InputStreamReader(fileInputStream);
this.processor= processor;
}
}
publicvoid encode(){
Token t;
while ((t = encodeChar()) !=null)
processor.process(t);
}
private Token encodeChar(int reader)
{
char[] buffer =newchar[10];
int count = 0;
int length;
while((length = in.read(inputFile)) !=-1){
count +=length;
}
return count;
}
publicclass StreamProcessorimplements Processor{
private OutputStream fileOutputStream;
// ctor
public StreamProcessor(fileInputStream fileOutputStream){
this.fileOutputStream= fileOutputStream;
}
publicvoid process(Token t){
outputFile.write(t.toString() +" ");
outputFile.write(chr);
}
}
publicvoid close(){
outputFile.close();
inputFile.close();
}
publicstaticvoid main (String[] args){
RunLengthEncoding();
}
}

