< prev index next >

src/java.base/share/classes/java/lang/System.java

Print this page

        

@@ -531,10 +531,40 @@
     public static native void arraycopy(Object src,  int  srcPos,
                                         Object dest, int destPos,
                                         int length);
 
     /**
+     * Set bit atomically
+     * @param bits   bits
+     * @param index  index
+     */
+    @HotSpotIntrinsicCandidate
+    public static void setBit(byte[] bits, int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Clear bit atomically
+     * @param bits   bits
+     * @param index  index
+     */
+    @HotSpotIntrinsicCandidate
+    public static void clrBit(byte[] bits, int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Get bit
+     * @param bits   bits
+     * @param index  index
+     * @return       value
+     */
+    public static boolean isBit(byte[] bits, int index) {
+        return ((bits[index>>3] >> (index & 7)) & 1) == 1;
+    }
+
+    /**
      * Returns the same hash code for the given object as
      * would be returned by the default method hashCode(),
      * whether or not the given object's class overrides
      * hashCode().
      * The hash code for the null reference is zero.
< prev index next >