类 BufferUtil

java.lang.Object
cn.jrack.core.util.BufferUtil

public class BufferUtil extends Object
本类的write部分摘自(感谢作者贡献):https://github.com/sea-boat/mysql-protocol.git
read部分自写
  • 构造器详细资料

    • BufferUtil

      public BufferUtil()
  • 方法详细资料

    • read

      public static byte read(ByteBuffer buffer)
    • readUB2

      public static int readUB2(ByteBuffer buffer)
    • readUB3

      public static int readUB3(ByteBuffer buffer)
    • readUB4

      public static long readUB4(ByteBuffer buffer)
    • readInt

      public static int readInt(ByteBuffer buffer)
    • readFloat

      public static float readFloat(ByteBuffer buffer)
    • readLong

      public static long readLong(ByteBuffer buffer)
      8个字节
      参数:
      buffer -
      返回:
    • readDouble

      public static double readDouble(ByteBuffer buffer)
    • readString

      public static String readString(ByteBuffer buffer)
    • readString

      public static String readString(ByteBuffer buffer, String charset)
    • readStringWithNull

      public static String readStringWithNull(ByteBuffer buffer, String charset)
    • readString

      public static String readString(ByteBuffer buffer, int length, String charset)
      读取指定长度的String
      参数:
      buffer -
      length -
      charset -
      返回:
    • readStringWithNull

      public static String readStringWithNull(ByteBuffer buffer)
    • readTime

      public static Time readTime(ByteBuffer buffer)
    • readDate

      public static Date readDate(ByteBuffer buffer)
    • move

      public static void move(int i, ByteBuffer buffer)
    • position

      public static void position(int i, ByteBuffer buffer)
    • writeUB2

      public static final void writeUB2(ByteBuffer buffer, int i)
    • writeUB3

      public static final void writeUB3(ByteBuffer buffer, int i)
    • writeInt

      public static final void writeInt(ByteBuffer buffer, int i)
    • writeFloat

      public static final void writeFloat(ByteBuffer buffer, float f)
    • writeUB4

      public static final void writeUB4(ByteBuffer buffer, long l)
    • writeLong

      public static final void writeLong(ByteBuffer buffer, long l)
    • writeDouble

      public static final void writeDouble(ByteBuffer buffer, double d)
    • writeLength

      public static final void writeLength(ByteBuffer buffer, long l)
    • writeWithNull

      public static final void writeWithNull(ByteBuffer buffer, byte[] src)
    • writeWithLength

      public static final void writeWithLength(ByteBuffer buffer, byte[] src)
    • writeWithLength

      public static final void writeWithLength(ByteBuffer buffer, byte[] src, byte nullValue)
    • getLength

      public static final int getLength(long length)
    • getLength

      public static final int getLength(byte[] src)