- 博客(0)
- 资源 (2)
- 收藏
- 关注
使用adobe flex 4访问数据.pdf
与借助于 JSP 和 servlet、ASP、PHP 或 CFML 创建的 HTML 模板集不同, Flex 区分客户端代码与服务器代码,它将应用
程序用户界面编译为二进制 SWF 文件,并发送到客户端。
当应用程序向数据服务发出请求时,不会重新编译 SWF 文件,也无需刷新页面。远程服务仅返回数据,随后 Flex 会将所返回
的数据绑定到客户端应用程序中的用户界面组件。
例如,在 Flex 中,当用户在应用程序中单击 Button 控件时,客户端代码会调用 Web 服务。从 Web 服务中获得的结果数据
将返回到二进制 SWF 文件中,而无需刷新页面。这样,结果数据即可作为动态内容应用于应用程序。
2010-10-20
PhoneBooks
基于J2ME的手机通讯录
public byte[] serialize() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.writeUTF(userName);
dos.writeUTF(mobilePhone);
dos.writeUTF(email);
dos.writeUTF(phone);
baos.close();
dos.close();
return baos.toByteArray();
}
public static Account deserialize(byte[] data) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(bais);
Account account = new Account();
account.userName = dis.readUTF();
account.mobilePhone = dis.readUTF();
account.phone = dis.readUTF();
account.email = dis.readUTF();
bais.close();
dis.close();
return account;
}
public static boolean matches(byte[] data, String userName) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(bais);
try {
return (dis.readUTF()).equals(userName);
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
}
2010-04-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人