klaus.fs
Class PGNStreamReader
java.lang.Object
klaus.fs.PGNStreamReader
public class PGNStreamReader
- extends Object
This class reads a PGN file without using a database key.
- Since:
- 2009-03-?? alpha2
- Author:
- Stephan Hillebrand
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
file
private RandomAccessFile file
lastLinePosition
private long lastLinePosition
PGNStreamReader
public PGNStreamReader(File pgnFile)
throws FileNotFoundException
- Create a new PGN file
- Parameters:
pgnFile
- the file to read
- Throws:
FileNotFoundException
- if the file does not exist
goTo
public void goTo(long target)
throws IOException
- Go to a certain pointer in the file
- Parameters:
target
-
- Throws:
IOException
getNextParty
public String getNextParty()
throws IOException,
EOFException
- Gets the next party. If you want a certain game, specify the game's starting position using
goTo(long) first, and then call getNextParty().
- Returns:
- a String containing the party, including all meta data.
- Throws:
IOException
- if the file could not be read
EOFException
- if no more parties are contained
getLastLinePosition
public long getLastLinePosition()
throws IOException
- Throws:
IOException