当前位置: 首页>>代码示例>>Java>>正文


Java PwDate类代码示例

本文整理汇总了Java中com.keepassdroid.database.PwDate的典型用法代码示例。如果您正苦于以下问题:Java PwDate类的具体用法?Java PwDate怎么用?Java PwDate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PwDate类属于com.keepassdroid.database包,在下文中一共展示了PwDate类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readGroupField

import com.keepassdroid.database.PwDate; //导入依赖的package包/类
/**
 * Parse and save one record from binary file.
 * @param buf
 * @param offset
 * @return If >0, 
 * @throws UnsupportedEncodingException 
 */
void readGroupField(PwDatabaseV3 db, PwGroupV3 grp, int fieldType, byte[] buf, int offset) throws UnsupportedEncodingException {
	switch( fieldType ) {
	case 0x0000 :
		// Ignore field
		break;
	case 0x0001 :
		grp.groupId = LEDataInputStream.readInt(buf, offset);
		break;
	case 0x0002 :
		grp.name = Types.readCString(buf, offset);
		break;
	case 0x0003 :
		grp.tCreation = new PwDate(buf, offset);
		break;
	case 0x0004 :
		grp.tLastMod = new PwDate(buf, offset);
		break;
	case 0x0005 :
		grp.tLastAccess = new PwDate(buf, offset);
		break;
	case 0x0006 :
		grp.tExpire = new PwDate(buf, offset);
		break;
	case 0x0007 :
		grp.icon = db.iconFactory.getIcon(LEDataInputStream.readInt(buf, offset));
		break;
	case 0x0008 :
		grp.level = LEDataInputStream.readUShort(buf, offset);
		break;
	case 0x0009 :
		grp.flags = LEDataInputStream.readInt(buf, offset);
		break;
	}
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:42,代码来源:ImporterV3.java

示例2: readEntryField

import com.keepassdroid.database.PwDate; //导入依赖的package包/类
void readEntryField(PwDatabaseV3 db, PwEntryV3 ent, byte[] buf, int offset)
throws UnsupportedEncodingException
{
	int fieldType = LEDataInputStream.readUShort(buf, offset);
	offset += 2;
	int fieldSize = LEDataInputStream.readInt(buf, offset);
	offset += 4;

	switch( fieldType ) {
	case 0x0000 :
		// Ignore field
		break;
	case 0x0001 :
		ent.setUUID(Types.bytestoUUID(buf, offset));
		break;
	case 0x0002 :
		ent.groupId = LEDataInputStream.readInt(buf, offset);
		break;
	case 0x0003 :
		int iconId = LEDataInputStream.readInt(buf, offset);
		
		// Clean up after bug that set icon ids to -1
		if (iconId == -1) {
			iconId = 0;
		}
		
		ent.icon = db.iconFactory.getIcon(iconId);
		break;
	case 0x0004 :
		ent.title = Types.readCString(buf, offset); 
		break;
	case 0x0005 :
		ent.url = Types.readCString(buf, offset);
		break;
	case 0x0006 :
		ent.username = Types.readCString(buf, offset);
		break;
	case 0x0007 :
		ent.setPassword(buf, offset, Types.strlen(buf, offset));
		break;
	case 0x0008 :
		ent.additional = Types.readCString(buf, offset);
		break;
	case 0x0009 :
		ent.tCreation = new PwDate(buf, offset);
		break;
	case 0x000A :
		ent.tLastMod = new PwDate(buf, offset);
		break;
	case 0x000B :
		ent.tLastAccess = new PwDate(buf, offset);
		break;
	case 0x000C :
		ent.tExpire = new PwDate(buf, offset);
		break;
	case 0x000D :
		ent.binaryDesc = Types.readCString(buf, offset);
		break;
	case 0x000E :
		ent.setBinaryData(buf, offset, fieldSize);
		break;
	}
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:64,代码来源:ImporterV3.java


注:本文中的com.keepassdroid.database.PwDate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。