private static void deserializeEntry(KdbDatabase database,DataInput dataInput) throws IOException {
  int fieldType;
  KdbEntry entry=new KdbEntry();
  while ((fieldType=dataInput.readUnsignedShort()) != 0xFFFF) {
switch (fieldType) {
case 0x0000:
      readExtData(dataInput);
    break;
case 0x0001:
  entry.setUuid(readUuid(dataInput));
break;
case 0x0002:
int groupId=readInt(dataInput);
Group group=database.findGroup(new UUID(0,groupId));
if (group == null) {
throw new IllegalStateException("Entry belongs to group that does not exist");
}
group.addEntry(entry);
break;
case 0x0003:
entry.setIcon(new KdbIcon(readInt(dataInput)));
break;
case 0x0004:
entry.setTitle(readString(dataInput));
break;
case 0x0005:
entry.setUrl(readString(dataInput));
break;
case 0x0006:
entry.setUsername(readString(dataInput));
break;
case 0x0007:
entry.setPassword(readString(dataInput));
break;
case 0x0008:
entry.setNotes(readString(dataInput));
break;
case 0x0009:
entry.setCreationTime(readDate(dataInput));
break;
case 0x000A:
entry.setLastModificationTime(readDate(dataInput));
break;
case 0x000B:
entry.setLastAccessTime(readDate(dataInput));
break;
case 0x000C:
entry.setExpiryTime(readDate(dataInput));
break;
case 0x000D:
entry.setBinaryDescription(readString(dataInput));
break;
case 0x000E:
entry.setBinaryData(readBuffer(dataInput));
break;
default :
throw new IllegalStateException("Unknown field type");
}
}
dataInput.readInt();
}

private static void deserializeEntry ( KdbDatabase database , DataInput dataInput ) throws IOException { int fieldType ; KdbEntry entry = new KdbEntry ( ) ; while ( ( fieldType = dataInput . readUnsignedShort ( ) ) != 0xFFFF ) { switch ( fieldType ) { case 0x0000 : readExtData ( dataInput ) ; break ; case 0x0001 : entry . setUuid ( readUuid ( dataInput ) ) ; break ; case 0x0002 : int groupId = readInt ( dataInput ) ; Group group = database . findGroup ( new UUID ( 0 , groupId ) ) ; if ( group == null ) { throw new IllegalStateException ( "Entry belongs to group that does not exist" ) ; } group . addEntry ( entry ) ; break ; case 0x0003 : entry . setIcon ( new KdbIcon ( readInt ( dataInput ) ) ) ; break ; case 0x0004 : entry . setTitle ( readString ( dataInput ) ) ; break ; case 0x0005 : entry . setUrl ( readString ( dataInput ) ) ; break ; case 0x0006 : entry . setUsername ( readString ( dataInput ) ) ; break ; case 0x0007 : entry . setPassword ( readString ( dataInput ) ) ; break ; case 0x0008 : entry . setNotes ( readString ( dataInput ) ) ; break ; case 0x0009 : entry . setCreationTime ( readDate ( dataInput ) ) ; break ; case 0x000A : entry . setLastModificationTime ( readDate ( dataInput ) ) ; break ; case 0x000B : entry . setLastAccessTime ( readDate ( dataInput ) ) ; break ; case 0x000C : entry . setExpiryTime ( readDate ( dataInput ) ) ; break ; case 0x000D : entry . setBinaryDescription ( readString ( dataInput ) ) ; break ; case 0x000E : entry . setBinaryData ( readBuffer ( dataInput ) ) ; break ; default : throw new IllegalStateException ( "Unknown field type" ) ; } } dataInput . readInt ( ) ; }
deserialize a kdbentry from a data source
