private static KdbGroup deserializeGroup(KdbGroup lastGroup,DataInput dataInput) throws IOException {
  int fieldType;
  KdbGroup group=new KdbGroup();
  while ((fieldType=dataInput.readUnsignedShort()) != 0xFFFF) {
switch (fieldType) {
case 0x0000:
      readExtData(dataInput);
    break;
case 0x0001:
  UUID uuid=new UUID(0,readInt(dataInput));
group.setUuid(uuid);
break;
case 0x0002:
group.setName(readString(dataInput));
break;
case 0x0003:
group.setCreationTime(readDate(dataInput));
break;
case 0x0004:
group.setLastModificationTime(readDate(dataInput));
break;
case 0x0005:
group.setLastAccessTime(readDate(dataInput));
break;
case 0x0006:
group.setExpiryTime(readDate(dataInput));
break;
case 0x0007:
group.setIcon(new KdbIcon(readInt(dataInput)));
break;
case 0x0008:
int level=readShort(dataInput);
group.setParent(computeParentGroup(lastGroup,level));
break;
case 0x0009:
group.setFlags(readInt(dataInput));
break;
default :
throw new IllegalStateException("Unknown field type");
}
}
dataInput.readInt();
return group;
}

private static KdbGroup deserializeGroup ( KdbGroup lastGroup , DataInput dataInput ) throws IOException { int fieldType ; KdbGroup group = new KdbGroup ( ) ; while ( ( fieldType = dataInput . readUnsignedShort ( ) ) != 0xFFFF ) { switch ( fieldType ) { case 0x0000 : readExtData ( dataInput ) ; break ; case 0x0001 : UUID uuid = new UUID ( 0 , readInt ( dataInput ) ) ; group . setUuid ( uuid ) ; break ; case 0x0002 : group . setName ( readString ( dataInput ) ) ; break ; case 0x0003 : group . setCreationTime ( readDate ( dataInput ) ) ; break ; case 0x0004 : group . setLastModificationTime ( readDate ( dataInput ) ) ; break ; case 0x0005 : group . setLastAccessTime ( readDate ( dataInput ) ) ; break ; case 0x0006 : group . setExpiryTime ( readDate ( dataInput ) ) ; break ; case 0x0007 : group . setIcon ( new KdbIcon ( readInt ( dataInput ) ) ) ; break ; case 0x0008 : int level = readShort ( dataInput ) ; group . setParent ( computeParentGroup ( lastGroup , level ) ) ; break ; case 0x0009 : group . setFlags ( readInt ( dataInput ) ) ; break ; default : throw new IllegalStateException ( "Unknown field type" ) ; } } dataInput . readInt ( ) ; return group ; }
deserialize a kdbgroup from a data source and attach it to the group structure of a database
