Class TypeSizes

java.lang.Object
org.apache.cassandra.db.TypeSizes

public final class TypeSizes extends Object
  • Field Details

  • Method Details

    • sizeof

      public static int sizeof(String value)
      assumes UTF8
    • encodedUTF8Length

      public static int encodedUTF8Length(String st)
      Java uses a Modified UTF-8 (see DataOutput.writeUTF(String)), and this method attempts to calculate the modified utf-8 length; this method only works when the utf-8 writing logic is java's modified utf-8 and will not work when normal utf-8 is written. If normal utf-8 is written, then CBUtil.encodedUTF8Length(String) should be used instread of this one.
      See Also:
    • sizeofWithShortLength

      public static int sizeofWithShortLength(ByteBuffer value)
    • sizeofWithLength

      public static int sizeofWithLength(ByteBuffer value)
    • sizeofWithVIntLength

      public static int sizeofWithVIntLength(ByteBuffer value)
    • sizeof

      public static int sizeof(boolean value)
    • sizeof

      public static int sizeof(byte value)
    • sizeof

      public static int sizeof(short value)
    • sizeof

      public static int sizeof(int value)
    • sizeof

      public static int sizeof(long value)
    • sizeof

      public static int sizeof(float value)
    • sizeof

      public static int sizeof(double value)
    • sizeof

      public static int sizeof(UUID value)
    • sizeofVInt

      public static int sizeofVInt(long value)
    • sizeofUnsignedVInt

      public static int sizeofUnsignedVInt(long value)