Package com.mysql.cj.protocol.a
Class NativeUtils
java.lang.Object
com.mysql.cj.protocol.a.NativeUtils
public class NativeUtils
extends java.lang.Object
Utilities to manipulate MySQL protocol-specific formats.
-
Method Summary
Modifier and Type Method Description static intdecodeMysqlThreeByteInteger(byte[] b)static intdecodeMysqlThreeByteInteger(byte[] b, int offset)static byte[]encodeMysqlThreeByteInteger(int i)static voidencodeMysqlThreeByteInteger(int i, byte[] b, int offset)static intgetBinaryEncodedLength(int type)Get the length of a binary-encoded value of the given type.
-
Method Details
-
encodeMysqlThreeByteInteger
public static byte[] encodeMysqlThreeByteInteger(int i) -
encodeMysqlThreeByteInteger
public static void encodeMysqlThreeByteInteger(int i, byte[] b, int offset) -
decodeMysqlThreeByteInteger
public static int decodeMysqlThreeByteInteger(byte[] b) -
decodeMysqlThreeByteInteger
public static int decodeMysqlThreeByteInteger(byte[] b, int offset) -
getBinaryEncodedLength
public static int getBinaryEncodedLength(int type)Get the length of a binary-encoded value of the given type.- Parameters:
type- type- Returns:
- the length (>0), 0 for a length-prefixed type, or -1 for unknown
-