com.hazelcast.nio

## Class UnsafeHelper

- java.lang.Object
- - com.hazelcast.nio.UnsafeHelper

- Deprecated.
  Use `MemoryAccessor` instead due to following reasons:

  Deprecated to `MemoryAccessor` due to following reasons:

  - Preventing hard-dependency to `Unsafe`/
  - Some platforms (such as SPARC) don't support unaligned memory access. So on these platforms memory access alignments must be checked and handled if possible.

      @Deprecated
       @PrivateApi
      public final class UnsafeHelper
      extends Object

  Unsafe accessor.

  Warning: Although both array base-offsets and array index-scales are constant over time currently, a later JVM implementation can change this behaviour to allow varying index-scales and base-offsets over time or per array instances (e.g. compressed primitive arrays or backwards growing arrays...)

  See Gil Tene's comment related to Unsafe usage; https://groups.google.com/d/msg/mechanical-sympathy/X-GtLuG0ETo/LMV1d_2IybQJ

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `BOOLEAN_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `BOOLEAN_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `BYTE_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `BYTE_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `CHAR_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `CHAR_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `DOUBLE_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `DOUBLE_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `FLOAT_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `FLOAT_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `INT_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `INT_ARRAY_INDEX_SCALE` Deprecated.
    `static long` | `LONG_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `LONG_ARRAY_INDEX_SCALE` Deprecated.
    `static int` | `MEM_COPY_THRESHOLD` Deprecated.
    `static long` | `SHORT_ARRAY_BASE_OFFSET` Deprecated.
    `static int` | `SHORT_ARRAY_INDEX_SCALE` Deprecated.
    `static sun.misc.Unsafe` | `UNSAFE` Deprecated. `GlobalMemoryAccessorRegistry.MEM` instead
    `static boolean` | `UNSAFE_AVAILABLE` Deprecated. `GlobalMemoryAccessorRegistry.MEM_AVAILABLE` instead

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### UNSAFE

          @Deprecated
          public static final sun.misc.Unsafe UNSAFE

      Deprecated. `GlobalMemoryAccessorRegistry.MEM` instead

    - #### UNSAFE_AVAILABLE

          @Deprecated
          public static final boolean UNSAFE_AVAILABLE

      Deprecated. `GlobalMemoryAccessorRegistry.MEM_AVAILABLE` instead

    - #### BYTE_ARRAY_BASE_OFFSET

          public static final long BYTE_ARRAY_BASE_OFFSET

      Deprecated.

    - #### BOOLEAN_ARRAY_BASE_OFFSET

          public static final long BOOLEAN_ARRAY_BASE_OFFSET

      Deprecated.

    - #### SHORT_ARRAY_BASE_OFFSET

          public static final long SHORT_ARRAY_BASE_OFFSET

      Deprecated.

    - #### CHAR_ARRAY_BASE_OFFSET

          public static final long CHAR_ARRAY_BASE_OFFSET

      Deprecated.

    - #### INT_ARRAY_BASE_OFFSET

          public static final long INT_ARRAY_BASE_OFFSET

      Deprecated.

    - #### FLOAT_ARRAY_BASE_OFFSET

          public static final long FLOAT_ARRAY_BASE_OFFSET

      Deprecated.

    - #### LONG_ARRAY_BASE_OFFSET

          public static final long LONG_ARRAY_BASE_OFFSET

      Deprecated.

    - #### DOUBLE_ARRAY_BASE_OFFSET

          public static final long DOUBLE_ARRAY_BASE_OFFSET

      Deprecated.

    - #### BOOLEAN_ARRAY_INDEX_SCALE

          public static final int BOOLEAN_ARRAY_INDEX_SCALE

      Deprecated.

    - #### BYTE_ARRAY_INDEX_SCALE

          public static final int BYTE_ARRAY_INDEX_SCALE

      Deprecated.

    - #### SHORT_ARRAY_INDEX_SCALE

          public static final int SHORT_ARRAY_INDEX_SCALE

      Deprecated.

    - #### CHAR_ARRAY_INDEX_SCALE

          public static final int CHAR_ARRAY_INDEX_SCALE

      Deprecated.

    - #### INT_ARRAY_INDEX_SCALE

          public static final int INT_ARRAY_INDEX_SCALE

      Deprecated.

    - #### FLOAT_ARRAY_INDEX_SCALE

          public static final int FLOAT_ARRAY_INDEX_SCALE

      Deprecated.

    - #### LONG_ARRAY_INDEX_SCALE

          public static final int LONG_ARRAY_INDEX_SCALE

      Deprecated.

    - #### DOUBLE_ARRAY_INDEX_SCALE

          public static final int DOUBLE_ARRAY_INDEX_SCALE

      Deprecated.

    - #### MEM_COPY_THRESHOLD

          public static final int MEM_COPY_THRESHOLD

      Deprecated.
      See Also:
        Constant Field Values

Copyright © 2019. All rights reserved.