Public feed #377837

Miscellany

public text v1 · immutable
Raw Edit
·published 2007-03-02 01:32 UTC
rendered paste body
public void code() {
        try {
            bw = new BufferedWriter(new FileWriter(new File(new StringBuilder().append(filename).append("-coded.txt").toString())));
            String read;
            while((read = br.readLine()) != null) {
                for(int x = 0; x <= read.toCharArray().length; x++) 
                     list.get(read.charAt(x));
                }
            }
            bw.close();
        } catch(IOException e) {
            e.printStackTrace();
        }
    }

[ERROR]
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 4
   at java.lang.String.charAt(libgcj.so.70)
   at Decoder.code(Decoder.java:66)
   at Decoder.<init>(Decoder.java:46)
   at Decoder.main(Decoder.java:80)