Code example for ObjectInputStream

Methods: readBoolean, readUTF

0
                out.writeUTF(diff);
            } 
        } 
 
        private void readObject(ObjectInputStream in) throws IOException,
                ClassNotFoundException { 
            boolean hasDiffString = in.readBoolean();
            if (hasDiffString) {
                diff = in.readUTF();
            } 
        } 
 
        protected Object writeReplace() {
            return this;
        } 
 
        protected Object readResolve() {
            return this;
        } 
    }