13,097
社区成员




/**
* 修改档案信息中的余额数据
* @param daId 档案ID
* @param cardNum 卡号
* @param Name 姓名
* @param Balance 余额
*/
public void updateWorker(String daId,String cardNum,String Name,String Balance,String fileName,String byteSize) {
FileConnection fc = null;
OutputStream os = null;
StringBuffer content=new StringBuffer();
content.append(daId);
content.append(cardNum);
content.append(Name);
content.append(Balance);
content.append("\r\n");
try {
fc = (FileConnection) Connector.open(filePath+"/"+fileName+".txt");
OutputStream out=fc.openOutputStream(Integer.parseInt(byteSize)); byte[] b=GbEnDecode.UCS2ToGB2312(content.toString());
out.write(b);
out.close();
fc.close();
fc = null;
} catch (IOException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} finally {
if (os != null) {
try {
os.close();
} catch (IOException e) {
e.printStackTrace();
}
os = null;
}
if (fc != null) {
try {
fc.close();
} catch (IOException e) {
e.printStackTrace();
}
fc = null;
}
}
}