public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   directRootSerialization = in.readBoolean();
   if (directRootSerialization) root = (VirtualFile) in.readObject();
   else {
     VirtualFileSerializator serializator = (VirtualFileSerializator) in.readObject();
     root = serializator.getFile();
   }
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeBoolean(directRootSerialization);
   if (directRootSerialization) out.writeObject(root);
   else out.writeObject(new VirtualFileSerializator(root));
 }