Code example for ObjectInput

Methods: readLongreadObject

0
     * @exception IOException On write problems 
     * @exception ClassNotFoundException On the class not being in the stream. 
     */ 
    public void readExternal(ObjectInput in)
            throws IOException, java.lang.ClassNotFoundException {
        this.scheduledInitialTime = in.readLong();
        this.scheduledInterval = in.readLong();
        this.lastRunTime = in.readLong();
        this.name = (String) in.readObject();
 
        // set scheduledInitialTime to make it in the future 
        if (scheduledInitialTime < System.currentTimeMillis()) {
            long n = System.currentTimeMillis() - scheduledInitialTime;
            n = n % scheduledInterval;
            this.scheduledInitialTime = System.currentTimeMillis() + n;
        } 
 
        // assume all deserialized tasks had setSchedule() called 
        hasBeenScheduled = true;
    } 
Experience pair programming with AI  Get Codota for Java