public final void readFromStream(DataInputStream dis,int version) throws IOException, ChessParseError {
  event=dis.readUTF();
  site=dis.readUTF();
  date=dis.readUTF();
  round=dis.readUTF();
  white=dis.readUTF();
  black=dis.readUTF();
  startPos=TextIO.readFEN(dis.readUTF());
  currentPos=new Position(startPos);
  timeControl=dis.readUTF();
  if (version >= 2) {
    whiteTimeControl=dis.readUTF();
    blackTimeControl=dis.readUTF();
  }
 else {
    whiteTimeControl="?";
    blackTimeControl="?";
  }
  int nTags=dis.readInt();
  tagPairs.clear();
  for (int i=0; i < nTags; i++) {
    TagPair tp=new TagPair();
    tp.tagName=dis.readUTF();
    tp.tagValue=dis.readUTF();
    tagPairs.add(tp);
  }
  rootNode=new Node();
  Node.readFromStream(dis,rootNode);
  currentNode=rootNode;
  int pathLen=dis.readInt();
  for (int i=0; i < pathLen; i++)   goForward(dis.readInt());
  updateListener();
}

public final void readFromStream ( DataInputStream dis , int version ) throws IOException , ChessParseError { event = dis . readUTF ( ) ; site = dis . readUTF ( ) ; date = dis . readUTF ( ) ; round = dis . readUTF ( ) ; white = dis . readUTF ( ) ; black = dis . readUTF ( ) ; startPos = TextIO . readFEN ( dis . readUTF ( ) ) ; currentPos = new Position ( startPos ) ; timeControl = dis . readUTF ( ) ; if ( version >= 2 ) { whiteTimeControl = dis . readUTF ( ) ; blackTimeControl = dis . readUTF ( ) ; } else { whiteTimeControl = "?" ; blackTimeControl = "?" ; } int nTags = dis . readInt ( ) ; tagPairs . clear ( ) ; for ( int i = 0 ; i < nTags ; i ++ ) { TagPair tp = new TagPair ( ) ; tp . tagName = dis . readUTF ( ) ; tp . tagValue = dis . readUTF ( ) ; tagPairs . add ( tp ) ; } rootNode = new Node ( ) ; Node . readFromStream ( dis , rootNode ) ; currentNode = rootNode ; int pathLen = dis . readInt ( ) ; for ( int i = 0 ; i < pathLen ; i ++ ) goForward ( dis . readInt ( ) ) ; updateListener ( ) ; }
de - serialize from input stream .
