类 BufferUtil
java.lang.Object
cn.jrack.core.util.BufferUtil
本类的write部分摘自(感谢作者贡献):https://github.com/sea-boat/mysql-protocol.git
read部分自写
read部分自写
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static final intgetLength(byte[] src) static final intgetLength(long length) static voidmove(int i, ByteBuffer buffer) static voidposition(int i, ByteBuffer buffer) static byteread(ByteBuffer buffer) static DatereadDate(ByteBuffer buffer) static doublereadDouble(ByteBuffer buffer) static floatreadFloat(ByteBuffer buffer) static intreadInt(ByteBuffer buffer) static longreadLong(ByteBuffer buffer) 8个字节static StringreadString(ByteBuffer buffer) static StringreadString(ByteBuffer buffer, int length, String charset) 读取指定长度的Stringstatic StringreadString(ByteBuffer buffer, String charset) static StringreadStringWithNull(ByteBuffer buffer) static StringreadStringWithNull(ByteBuffer buffer, String charset) static TimereadTime(ByteBuffer buffer) static intreadUB2(ByteBuffer buffer) static intreadUB3(ByteBuffer buffer) static longreadUB4(ByteBuffer buffer) static final voidwriteDouble(ByteBuffer buffer, double d) static final voidwriteFloat(ByteBuffer buffer, float f) static final voidwriteInt(ByteBuffer buffer, int i) static final voidwriteLength(ByteBuffer buffer, long l) static final voidwriteLong(ByteBuffer buffer, long l) static final voidwriteUB2(ByteBuffer buffer, int i) static final voidwriteUB3(ByteBuffer buffer, int i) static final voidwriteUB4(ByteBuffer buffer, long l) static final voidwriteWithLength(ByteBuffer buffer, byte[] src) static final voidwriteWithLength(ByteBuffer buffer, byte[] src, byte nullValue) static final voidwriteWithNull(ByteBuffer buffer, byte[] src)
-
构造器详细资料
-
BufferUtil
public BufferUtil()
-
-
方法详细资料
-
read
-
readUB2
-
readUB3
-
readUB4
-
readInt
-
readFloat
-
readLong
8个字节- 参数:
buffer-- 返回:
-
readDouble
-
readString
-
readString
-
readStringWithNull
-
readString
读取指定长度的String- 参数:
buffer-length-charset-- 返回:
-
readStringWithNull
-
readTime
-
readDate
-
move
-
position
-
writeUB2
-
writeUB3
-
writeInt
-
writeFloat
-
writeUB4
-
writeLong
-
writeDouble
-
writeLength
-
writeWithNull
-
writeWithLength
-
writeWithLength
-
getLength
public static final int getLength(long length) -
getLength
public static final int getLength(byte[] src)
-