< prev index next >
src/java.base/share/classes/java/math/BigInteger.java
Print this page
*** 4602,4611 ****
--- 4602,4612 ----
}
return fn;
}
/** use serialVersionUID from JDK 1.1. for interoperability */
+ @java.io.Serial
private static final long serialVersionUID = -8287574255936472291L;
/**
* Serializable fields for BigInteger.
*
*** 4620,4629 ****
--- 4621,4631 ----
* @serialField firstNonzeroByteNum int
* appears in the serialized form for backward compatibility
* @serialField lowestSetBit int
* appears in the serialized form for backward compatibility
*/
+ @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("signum", Integer.TYPE),
new ObjectStreamField("magnitude", byte[].class),
new ObjectStreamField("bitCount", Integer.TYPE),
new ObjectStreamField("bitLength", Integer.TYPE),
*** 4641,4650 ****
--- 4643,4653 ----
* bitLengthPlusOne and lowestSetBitPlusTwo, to 0 rather than some other
* marker value. Therefore, no explicit action to set these fields needs to
* be taken in readObject because those fields already have a 0 value by
* default since defaultReadObject is not being used.
*/
+ @java.io.Serial
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// prepare to read the alternate persistent fields
ObjectInputStream.GetField fields = s.readFields();
*** 4707,4716 ****
--- 4710,4720 ----
* {@code bitCount}, {@code bitLength}, {@code lowestSetBit}, and
* {@code firstNonzeroByteNum}, respectively. These values are compatible
* with older implementations, but will be ignored by current
* implementations.
*/
+ @java.io.Serial
private void writeObject(ObjectOutputStream s) throws IOException {
// set the values of the Serializable fields
ObjectOutputStream.PutField fields = s.putFields();
fields.put("signum", signum);
fields.put("magnitude", magSerializedForm());
< prev index next >