|
@@ -24,7 +24,6 @@ package com.dmdirc.util.io;
|
24
|
24
|
|
25
|
25
|
import java.io.EOFException;
|
26
|
26
|
import java.io.File;
|
27
|
|
-import java.io.FileNotFoundException;
|
28
|
27
|
import java.io.IOException;
|
29
|
28
|
import java.io.RandomAccessFile;
|
30
|
29
|
import java.nio.charset.Charset;
|
|
@@ -139,7 +138,7 @@ public class ReverseFileReader {
|
139
|
138
|
throw new EOFException("Reached Start of file");
|
140
|
139
|
}
|
141
|
140
|
|
142
|
|
- // Keep looping untill we get a full line, or the end of the file
|
|
141
|
+ // Keep looping until we get a full line, or the end of the file
|
143
|
142
|
boolean keepLooping = true;
|
144
|
143
|
boolean gotNewLine;
|
145
|
144
|
while (keepLooping) {
|
|
@@ -167,7 +166,7 @@ public class ReverseFileReader {
|
167
|
166
|
// And loop looking for data
|
168
|
167
|
// This uses seekDistance so that only wanted data is checked.
|
169
|
168
|
for (int i = seekDistance - 1; i >= 0; --i) {
|
170
|
|
- // Check for New line Character, or a non carraige-return char
|
|
169
|
+ // Check for New line Character, or a non carriage-return char
|
171
|
170
|
if (bytes[i] == '\n') {
|
172
|
171
|
// Seek to the location of this character and exit this loop.
|
173
|
172
|
file.seek(fp + i);
|
|
@@ -184,7 +183,7 @@ public class ReverseFileReader {
|
184
|
183
|
|
185
|
184
|
if (fp == 0 && !gotNewLine) {
|
186
|
185
|
// This part of the loop started from the start of the file, but didn't
|
187
|
|
- // find a new line anywhere. no more loops are posssible, so Treat
|
|
186
|
+ // find a new line anywhere. no more loops are possible, so Treat
|
188
|
187
|
// this as "got new line"
|
189
|
188
|
gotNewLine = true;
|
190
|
189
|
file.seek(0);
|