Usar mark(int) y reset() con un LineNumberReader
    
		    Hola a todos, necesitaba tener acceso a distintas lineas de un fichero continuamente y creo que con los metodos mark y reset es la mejor opcion pero no consigo que me vuelva a dar una linea ya leida, siempre devuelve null al leerla de nuevo.¿Alguien sabe como se usan estos metodos?Os pongo el codigo que hice:
import java.io.*;
public class GestorErrores {
private int numeroErrores;
private LineNumberReader bufferFicheroErrores;
  
public GestorErrores(String nombreFicheroErrores) {
try {
bufferFicheroErrores = new LineNumberReader(new BufferedReader(new
FileReader(nombreFicheroErrores)));
numeroErrores = enumerarErrores();
bufferFicheroErrores.mark(23);
}
catch (IOException ioe) {
}
}
public void mostrarError(int numeroError) {
try {
if ( (numeroErrores == 0) || (numeroErrores < numeroError)) {
toString("Codigo de error no reconocido");
}
else {
bufferFicheroErrores.reset();
bufferFicheroErrores.setLineNumber(numeroError);
bufferFicheroErrores.readLine();
toString("Codigo error Nº" + numeroError + ": " +
bufferFicheroErrores.readLine());
}
}
catch (IOException e) {
toString("Fallo al leer el fichero errores.dat");
}
}
private int enumerarErrores() {
try {
while (bufferFicheroErrores.ready()) {
bufferFicheroErrores.readLine();
}
}
catch (IOException e) {
toString("Fallo al leer el fichero errores.dat");
}
return bufferFicheroErrores.getLineNumber();
}
public void toString(String mensaje) {
System.err.println(mensaje);
}
}
Muchas gracias
Valirc
    import java.io.*;
public class GestorErrores {
private int numeroErrores;
private LineNumberReader bufferFicheroErrores;
public GestorErrores(String nombreFicheroErrores) {
try {
bufferFicheroErrores = new LineNumberReader(new BufferedReader(new
FileReader(nombreFicheroErrores)));
numeroErrores = enumerarErrores();
bufferFicheroErrores.mark(23);
}
catch (IOException ioe) {
}
}
public void mostrarError(int numeroError) {
try {
if ( (numeroErrores == 0) || (numeroErrores < numeroError)) {
toString("Codigo de error no reconocido");
}
else {
bufferFicheroErrores.reset();
bufferFicheroErrores.setLineNumber(numeroError);
bufferFicheroErrores.readLine();
toString("Codigo error Nº" + numeroError + ": " +
bufferFicheroErrores.readLine());
}
}
catch (IOException e) {
toString("Fallo al leer el fichero errores.dat");
}
}
private int enumerarErrores() {
try {
while (bufferFicheroErrores.ready()) {
bufferFicheroErrores.readLine();
}
}
catch (IOException e) {
toString("Fallo al leer el fichero errores.dat");
}
return bufferFicheroErrores.getLineNumber();
}
public void toString(String mensaje) {
System.err.println(mensaje);
}
}
Muchas gracias
Valirc
