Package org.apache.cassandra.db
Class TypeSizes
java.lang.Object
org.apache.cassandra.db.TypeSizes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intJava uses a Modified UTF-8 (seeDataOutput.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.static intsizeof(boolean value) static intsizeof(byte value) static intsizeof(double value) static intsizeof(float value) static intsizeof(int value) static intsizeof(long value) static intsizeof(short value) static intassumes UTF8static intstatic intsizeofUnsignedVInt(long value) static intsizeofVInt(long value) static intsizeofWithLength(ByteBuffer value) static intsizeofWithShortLength(ByteBuffer value) static intsizeofWithVIntLength(ByteBuffer value)
-
Field Details
-
BOOL_SIZE
public static final int BOOL_SIZE- See Also:
-
BYTE_SIZE
public static final int BYTE_SIZE- See Also:
-
CHAR_SIZE
public static final int CHAR_SIZE- See Also:
-
SHORT_SIZE
public static final int SHORT_SIZE- See Also:
-
INT_SIZE
public static final int INT_SIZE- See Also:
-
LONG_SIZE
public static final int LONG_SIZE- See Also:
-
FLOAT_SIZE
public static final int FLOAT_SIZE- See Also:
-
DOUBLE_SIZE
public static final int DOUBLE_SIZE- See Also:
-
UUID_SIZE
public static final int UUID_SIZE- See Also:
-
-
Method Details
-
sizeof
assumes UTF8 -
encodedUTF8Length
Java uses a Modified UTF-8 (seeDataOutput.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, thenCBUtil.encodedUTF8Length(String)should be used instread of this one.- See Also:
-
sizeofWithShortLength
-
sizeofWithLength
-
sizeofWithVIntLength
-
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
-
sizeofVInt
public static int sizeofVInt(long value) -
sizeofUnsignedVInt
public static int sizeofUnsignedVInt(long value)
-