org.apache.cassandra.utils

## Class FastByteOperations.UnsafeOperations

- java.lang.Object
- - org.apache.cassandra.utils.FastByteOperations.UnsafeOperations

- All Implemented Interfaces:
    FastByteOperations.ByteOperations
  Enclosing class:
    FastByteOperations

      public static final class FastByteOperations.UnsafeOperations
      extends java.lang.Object
      implements FastByteOperations.ByteOperations

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnsafeOperations()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)`
    `int` | `compare(java.nio.ByteBuffer buffer1, byte[] buffer2, int offset2, int length2)`
    `int` | `compare(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)`
    `static int` | `compareTo(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)`
    `static int` | `compareTo(java.lang.Object buffer1, long offset1, int length1, java.nio.ByteBuffer buffer)`
    `static int` | `compareTo(java.lang.Object buffer1, long memoryOffset1, int length1, java.lang.Object buffer2, long memoryOffset2, int length2)` Lexicographically compare two arrays.
    `void` | `copy(java.nio.ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length)`
    `void` | `copy(java.nio.ByteBuffer srcBuf, int srcPosition, java.nio.ByteBuffer trgBuf, int trgPosition, int length)`
    `static void` | `copy(java.lang.Object src, long srcOffset, byte[] trg, int trgPosition, int length)`
    `static void` | `copy(java.lang.Object src, long srcOffset, java.nio.ByteBuffer trgBuf, int trgPosition, int length)`
    `static void` | `copy(java.lang.Object src, long srcOffset, java.lang.Object dst, long dstOffset, long length)`

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

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

- - ### Constructor Detail

    - #### UnsafeOperations

          public UnsafeOperations()

  - ### Method Detail

    - #### compare

          public int compare(byte[] buffer1,
                             int offset1,
                             int length1,
                             byte[] buffer2,
                             int offset2,
                             int length2)

      Specified by:
        `compare` in interface `FastByteOperations.ByteOperations`

    - #### compare

          public int compare(java.nio.ByteBuffer buffer1,
                             byte[] buffer2,
                             int offset2,
                             int length2)

      Specified by:
        `compare` in interface `FastByteOperations.ByteOperations`

    - #### compare

          public int compare(java.nio.ByteBuffer buffer1,
                             java.nio.ByteBuffer buffer2)

      Specified by:
        `compare` in interface `FastByteOperations.ByteOperations`

    - #### copy

          public void copy(java.nio.ByteBuffer src,
                           int srcPosition,
                           byte[] trg,
                           int trgPosition,
                           int length)

      Specified by:
        `copy` in interface `FastByteOperations.ByteOperations`

    - #### copy

          public void copy(java.nio.ByteBuffer srcBuf,
                           int srcPosition,
                           java.nio.ByteBuffer trgBuf,
                           int trgPosition,
                           int length)

      Specified by:
        `copy` in interface `FastByteOperations.ByteOperations`

    - #### copy

          public static void copy(java.lang.Object src,
                                  long srcOffset,
                                  java.nio.ByteBuffer trgBuf,
                                  int trgPosition,
                                  int length)

    - #### copy

          public static void copy(java.lang.Object src,
                                  long srcOffset,
                                  byte[] trg,
                                  int trgPosition,
                                  int length)

    - #### copy

          public static void copy(java.lang.Object src,
                                  long srcOffset,
                                  java.lang.Object dst,
                                  long dstOffset,
                                  long length)

    - #### compareTo

          @Inline
          public static int compareTo(java.nio.ByteBuffer buffer1,
                                              java.nio.ByteBuffer buffer2)

    - #### compareTo

          @Inline
          public static int compareTo(java.lang.Object buffer1,
                                              long offset1,
                                              int length1,
                                              java.nio.ByteBuffer buffer)

    - #### compareTo

          @Inline
          public static int compareTo(java.lang.Object buffer1,
                                              long memoryOffset1,
                                              int length1,
                                              java.lang.Object buffer2,
                                              long memoryOffset2,
                                              int length2)

      Lexicographically compare two arrays.
      Parameters:
        `buffer1` - left operand: a byte[] or null
        `buffer2` - right operand: a byte[] or null
        `memoryOffset1` - Where to start comparing in the left buffer (pure memory address if buffer1 is null, or relative otherwise)
        `memoryOffset2` - Where to start comparing in the right buffer (pure memory address if buffer1 is null, or relative otherwise)
        `length1` - How much to compare from the left buffer
        `length2` - How much to compare from the right buffer
      Returns:
        0 if equal, `< 0` if left is less than right, etc.

Copyright © 2018 The Apache Software Foundation