Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created March 2, 2016 12:56
Show Gist options
  • Save codenameone/843b48b703431236c875 to your computer and use it in GitHub Desktop.
Save codenameone/843b48b703431236c875 to your computer and use it in GitHub Desktop.
Example of the Codename One Externalizable interface usage
public void externalize(DataOutputStream out) throws IOException {
Util.writeUTF(name, out);
Util.writeUTF(value, out);
Util.writeUTF(domain, out);
out.writeLong(expires);
}
public void internalize(int version, DataInputStream in) throws IOException {
name = Util.readUTF(in);
value = Util.readUTF(in);
domain = Util.readUTF(in);
expires = in.readLong();
}
@codenameone
Copy link
Author

Sample code for Externalizable.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment