< prev index next >
src/java.base/share/classes/java/util/BitSet.java
Print this page
@@ -81,10 +81,11 @@
*
* The bits in this BitSet. The ith bit is stored in bits[i/64] at
* bit position i % 64 (where bit position 0 refers to the least
* significant bit and 63 refers to the most significant bit).
*/
+ @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("bits", long[].class),
};
/**
@@ -102,10 +103,11 @@
* the user knows what he's doing and try harder to preserve it.
*/
private transient boolean sizeIsSticky = false;
/* use serialVersionUID from JDK 1.0.2 for interoperability */
+ @java.io.Serial
private static final long serialVersionUID = 7997698588986878753L;
/**
* Given a bit index, return word index containing it.
*/
@@ -1122,10 +1124,11 @@
/**
* Save the state of the {@code BitSet} instance to a stream (i.e.,
* serialize it).
*/
+ @java.io.Serial
private void writeObject(ObjectOutputStream s)
throws IOException {
checkInvariants();
@@ -1139,10 +1142,11 @@
/**
* Reconstitute the {@code BitSet} instance from a stream (i.e.,
* deserialize it).
*/
+ @java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();
words = (long[]) fields.get("bits", null);
< prev index next >