Code example for ObjectInput

Methods: readBooleanreadInt

0
        this.serializable = accptdValue;
    } 
     
    @Override 
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal(in);
        timestamp = in.readInt();
        boolean hasAccepted = in.readBoolean();
        if(hasAccepted){
            highestA = (Integer) in.readInt();
        } 
    } 
     
    @Override 
    public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        out.writeInt(timestamp);
        if(highestA == null)
            out.writeBoolean(false); //hasAccepted
        else{