public void serialize(DataOutput out) throws IOException {
  out.writeUTF(id);
  out.writeUTF(version);
  out.writeInt(sourceFiles.size());
  for (  Entry<String,List<RevisionFile>> e : sourceFiles.entrySet()) {
    out.writeUTF(e.getKey());
    List<RevisionFile> files=e.getValue();
    out.writeInt(files.size());
    for (    RevisionFile file : files) {
      out.writeUTF(file.fileName);
      out.writeLong(file.size);
    }
  }
}

public void serialize ( DataOutput out ) throws IOException { out . writeUTF ( id ) ; out . writeUTF ( version ) ; out . writeInt ( sourceFiles . size ( ) ) ; for ( Entry < String , List < RevisionFile > > e : sourceFiles . entrySet ( ) ) { out . writeUTF ( e . getKey ( ) ) ; List < RevisionFile > files = e . getValue ( ) ; out . writeInt ( files . size ( ) ) ; for ( RevisionFile file : files ) { out . writeUTF ( file . fileName ) ; out . writeLong ( file . size ) ; } } }
serialize the token data for communication between server and client .
