public String readLine() throws Exception {
        int thisCode;
        char thisChar;
        String finalLine="";

        // If our position is less than zero already, we are at the beginning
        // with nothing to return.
        if ( this.position < 0 ) {
            return null;
        }

        for(;;) {
            //System.err.println(this.position + " " +finalLine);
            // we've reached the beginning of the file
            if ( this.position < 0 ) {
                break;
            }
            // Seek to the current position
            this.randomfile.seek(this.position);

            // Read the data at this position
            thisCode=this.randomfile.readByte();
            thisChar=(char)thisCode;

            // If this is a line break or carrige return, stop looking
            if (thisCode == 13 || thisCode == 10 ) {
                // See if the previous character is also a line break character.
                // this accounts for crlf combinations
                this.randomfile.seek(this.position-1);
                int nextCode=this.randomfile.readByte();
                if ( (thisCode == 10 && nextCode == 13) || (thisCode == 13 && nextCode == 10) ) {
                    // If we found another linebreak character, ignore it
                    this.position=this.position-1;
                }
                // Move the pointer for the next readline
                this.position--;
                break;
            } else {
                // This is a valid character append to the string
                finalLine=thisChar + finalLine;
            }
            // Move to the next char
            this.position--;
        }
        // return the line
        // return finalLine
        return new String(finalLine.getBytes("Latin1"),"UTF8");
    }