Class ByteArrayUtil

java.lang.Object
org.apache.cassandra.utils.ByteArrayUtil

public class ByteArrayUtil extends Object
  • Field Details

    • EMPTY_BYTE_ARRAY

      public static final byte[] EMPTY_BYTE_ARRAY
  • Constructor Details

    • ByteArrayUtil

      public ByteArrayUtil()
  • Method Details

    • compareUnsigned

      public static int compareUnsigned(byte[] o1, byte[] o2)
    • compareUnsigned

      public static int compareUnsigned(byte[] o1, int off1, byte[] o2, int off2, int len)
    • bytes

      public static byte[] bytes(byte b)
    • bytes

      public static byte[] bytes(int v)
    • bytes

      public static byte[] bytes(long v)
    • bytes

      public static byte[] bytes(short v)
    • bytes

      public static byte[] bytes(float v)
    • bytes

      public static byte[] bytes(double v)
    • bytes

      public static byte[] bytes(String v)
    • bytes

      public static byte[] bytes(String v, Charset charset)
    • getBoolean

      public static boolean getBoolean(byte[] b, int off)
    • getChar

      public static char getChar(byte[] b, int off)
    • getShort

      public static short getShort(byte[] b, int off)
    • getUnsignedShort

      public static int getUnsignedShort(byte[] b, int off)
    • getInt

      public static int getInt(byte[] b, int off)
    • getInt

      public static int getInt(byte[] b)
    • getFloat

      public static float getFloat(byte[] b, int off)
    • getLong

      public static long getLong(byte[] b)
    • getLong

      public static long getLong(byte[] b, int off)
    • getDouble

      public static double getDouble(byte[] b, int off)
    • putBoolean

      public static void putBoolean(byte[] b, int off, boolean val)
    • putChar

      public static void putChar(byte[] b, int off, char val)
    • putShort

      public static void putShort(byte[] b, int off, short val)
    • putInt

      public static void putInt(byte[] b, int off, int val)
    • putFloat

      public static void putFloat(byte[] b, int off, float val)
    • putLong

      public static void putLong(byte[] b, int off, long val)
    • putDouble

      public static void putDouble(byte[] b, int off, double val)
    • bytesToHex

      public static String bytesToHex(byte[] bytes)
    • hexToBytes

      public static byte[] hexToBytes(String hex)
    • string

      public static String string(byte[] bytes) throws CharacterCodingException
      Throws:
      CharacterCodingException
    • string

      public static String string(byte[] buffer, Charset charset) throws CharacterCodingException
      Throws:
      CharacterCodingException
    • writeWithLength

      public static void writeWithLength(byte[] bytes, DataOutput out) throws IOException
      Throws:
      IOException
    • writeWithShortLength

      public static void writeWithShortLength(byte[] buffer, DataOutput out) throws IOException
      Throws:
      IOException
    • writeWithVIntLength

      public static void writeWithVIntLength(byte[] bytes, DataOutputPlus out) throws IOException
      Throws:
      IOException
    • serializedSizeWithVIntLength

      public static int serializedSizeWithVIntLength(byte[] bytes)
    • readWithLength

      public static byte[] readWithLength(DataInput in) throws IOException
      Throws:
      IOException
    • readWithShortLength

      public static byte[] readWithShortLength(DataInput in) throws IOException
      Throws:
      IOException
    • readWithVIntLength

      public static byte[] readWithVIntLength(DataInputPlus in) throws IOException
      Throws:
      IOException
    • copyBytes

      public static void copyBytes(byte[] src, int srcPos, byte[] dst, int dstPos, int length)
    • copyBytes

      public static void copyBytes(byte[] src, int srcPos, ByteBuffer dst, int dstPos, int length)