< prev index next >

src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialStruct.java

Print this page




 315     }
 316 
 317     /**
 318      * readObject is called to restore the state of the {@code SerialStruct} from
 319      * a stream.
 320      */
 321     private void readObject(ObjectInputStream s)
 322             throws IOException, ClassNotFoundException {
 323 
 324        ObjectInputStream.GetField fields = s.readFields();
 325        Object[] tmp = (Object[])fields.get("attribs", null);
 326        attribs = tmp == null ? null : tmp.clone();
 327        SQLTypeName = (String)fields.get("SQLTypeName", null);
 328     }
 329 
 330     /**
 331      * writeObject is called to save the state of the {@code SerialStruct}
 332      * to a stream.
 333      */
 334     private void writeObject(ObjectOutputStream s)
 335             throws IOException, ClassNotFoundException {
 336 
 337         ObjectOutputStream.PutField fields = s.putFields();
 338         fields.put("attribs", attribs);
 339         fields.put("SQLTypeName", SQLTypeName);
 340         s.writeFields();
 341     }
 342 
 343     /**
 344      * The identifier that assists in the serialization of this
 345      * <code>SerialStruct</code> object.
 346      */
 347     static final long serialVersionUID = -8322445504027483372L;
 348 }


 315     }
 316 
 317     /**
 318      * readObject is called to restore the state of the {@code SerialStruct} from
 319      * a stream.
 320      */
 321     private void readObject(ObjectInputStream s)
 322             throws IOException, ClassNotFoundException {
 323 
 324        ObjectInputStream.GetField fields = s.readFields();
 325        Object[] tmp = (Object[])fields.get("attribs", null);
 326        attribs = tmp == null ? null : tmp.clone();
 327        SQLTypeName = (String)fields.get("SQLTypeName", null);
 328     }
 329 
 330     /**
 331      * writeObject is called to save the state of the {@code SerialStruct}
 332      * to a stream.
 333      */
 334     private void writeObject(ObjectOutputStream s)
 335             throws IOException {
 336 
 337         ObjectOutputStream.PutField fields = s.putFields();
 338         fields.put("attribs", attribs);
 339         fields.put("SQLTypeName", SQLTypeName);
 340         s.writeFields();
 341     }
 342 
 343     /**
 344      * The identifier that assists in the serialization of this
 345      * <code>SerialStruct</code> object.
 346      */
 347     static final long serialVersionUID = -8322445504027483372L;
 348 }
< prev index next >