Code example for ObjectInput

Methods: readInt

0
 
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeInt(id);
    } 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        id  = in.readInt();
    } 
 
    public MockFactHandle(final int id) {
        this.id = id;
    } 
 
    public String toExternalForm() {
        return "[fact:" + this.id + "]";
    } 
 
    public int hashCode() { 
        return this.id;
    }