类 NativeUtils


  • public class NativeUtils
    extends Object
    Utilities to manipulate MySQL protocol-specific formats.
    • 方法详细资料

      • 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.
        参数:
        type - type
        返回:
        the length (>0), 0 for a length-prefixed type, or -1 for unknown