类 MysqlTextValueDecoder
- java.lang.Object
-
- com.mysql.cj.protocol.a.MysqlTextValueDecoder
-
- 所有已实现的接口:
ValueDecoder
public class MysqlTextValueDecoder extends Object implements ValueDecoder
Implementation ofValueDecoderfor the MySQL text protocol. All values will be received as LengthEncodedString values.Refer to MySQL documentation for format of values as strings.
Numeric values are returned as ASCII (encoding=63/binary).
-
-
字段概要
字段 修饰符和类型 字段 说明 static intDATE_BUF_LENBuffer length of MySQL date string: 'YYYY-MM-DD'.static intMAX_SIGNED_LONG_LENMax string length of a signed long = 9223372036854775807 (19+1 for minus sign)static PatternTIME_PTRNstatic intTIME_STR_LEN_MAX_NO_FRACMax string length of MySQL time string (with microseconds): '-HHH:MM:SS'.static intTIME_STR_LEN_MAX_WITH_MICROSMax string length of MySQL time string (with microseconds): '-HHH:MM:SS.mmmmmm'.static intTIME_STR_LEN_MINMin string length of MySQL time string: 'HH:MM:SS'.static intTIMESTAMP_STR_LEN_NO_FRACString length of MySQL timestamp string (no microseconds): 'YYYY-MM-DD HH:MM:SS'.static intTIMESTAMP_STR_LEN_WITH_MICROSMax string length of MySQL timestamp (with microsecs): 'YYYY-MM-DD HH:MM:SS.mmmmmm'.static intTIMESTAMP_STR_LEN_WITH_NANOSString length of String timestamp with nanos.
-
构造器概要
构造器 构造器 说明 MysqlTextValueDecoder()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> TdecodeBit(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeByteArray(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)<T> TdecodeDate(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeDatetime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)<T> TdecodeDecimal(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeDouble(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeFloat(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeSet(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)<T> TdecodeTime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)<T> TdecodeTimestamp(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)<T> TdecodeUInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeUInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeUInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeUInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)<T> TdecodeYear(byte[] bytes, int offset, int length, ValueFactory<T> vf)static BigIntegergetBigInteger(byte[] buf, int offset, int length)static InternalDategetDate(byte[] bytes, int offset, int length)static DoublegetDouble(byte[] bytes, int offset, int length)static intgetInt(byte[] buf, int offset, int endpos)static longgetLong(byte[] buf, int offset, int endpos)static InternalTimegetTime(byte[] bytes, int offset, int length, int scale)static InternalTimestampgetTimestamp(byte[] bytes, int offset, int length, int scale)static booleanisDate(String s)static booleanisTime(String s)static booleanisTimestamp(String s)
-
-
-
字段详细资料
-
DATE_BUF_LEN
public static final int DATE_BUF_LEN
Buffer length of MySQL date string: 'YYYY-MM-DD'.- 另请参阅:
- 常量字段值
-
TIME_STR_LEN_MIN
public static final int TIME_STR_LEN_MIN
Min string length of MySQL time string: 'HH:MM:SS'.- 另请参阅:
- 常量字段值
-
TIME_STR_LEN_MAX_NO_FRAC
public static final int TIME_STR_LEN_MAX_NO_FRAC
Max string length of MySQL time string (with microseconds): '-HHH:MM:SS'.- 另请参阅:
- 常量字段值
-
TIME_STR_LEN_MAX_WITH_MICROS
public static final int TIME_STR_LEN_MAX_WITH_MICROS
Max string length of MySQL time string (with microseconds): '-HHH:MM:SS.mmmmmm'.- 另请参阅:
- 常量字段值
-
TIMESTAMP_STR_LEN_NO_FRAC
public static final int TIMESTAMP_STR_LEN_NO_FRAC
String length of MySQL timestamp string (no microseconds): 'YYYY-MM-DD HH:MM:SS'.- 另请参阅:
- 常量字段值
-
TIMESTAMP_STR_LEN_WITH_MICROS
public static final int TIMESTAMP_STR_LEN_WITH_MICROS
Max string length of MySQL timestamp (with microsecs): 'YYYY-MM-DD HH:MM:SS.mmmmmm'.- 另请参阅:
- 常量字段值
-
TIMESTAMP_STR_LEN_WITH_NANOS
public static final int TIMESTAMP_STR_LEN_WITH_NANOS
String length of String timestamp with nanos. This does not come from MySQL server but we support it via string conversion.- 另请参阅:
- 常量字段值
-
TIME_PTRN
public static final Pattern TIME_PTRN
-
MAX_SIGNED_LONG_LEN
public static final int MAX_SIGNED_LONG_LEN
Max string length of a signed long = 9223372036854775807 (19+1 for minus sign)- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
decodeDate
public <T> T decodeDate(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeDate在接口中ValueDecoder
-
decodeTime
public <T> T decodeTime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)- 指定者:
decodeTime在接口中ValueDecoder
-
decodeTimestamp
public <T> T decodeTimestamp(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)- 指定者:
decodeTimestamp在接口中ValueDecoder
-
decodeDatetime
public <T> T decodeDatetime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)- 指定者:
decodeDatetime在接口中ValueDecoder
-
decodeUInt1
public <T> T decodeUInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeUInt1在接口中ValueDecoder
-
decodeInt1
public <T> T decodeInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeInt1在接口中ValueDecoder
-
decodeUInt2
public <T> T decodeUInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeUInt2在接口中ValueDecoder
-
decodeInt2
public <T> T decodeInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeInt2在接口中ValueDecoder
-
decodeUInt4
public <T> T decodeUInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeUInt4在接口中ValueDecoder
-
decodeInt4
public <T> T decodeInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeInt4在接口中ValueDecoder
-
decodeUInt8
public <T> T decodeUInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeUInt8在接口中ValueDecoder
-
decodeInt8
public <T> T decodeInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeInt8在接口中ValueDecoder
-
decodeFloat
public <T> T decodeFloat(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeFloat在接口中ValueDecoder
-
decodeDouble
public <T> T decodeDouble(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeDouble在接口中ValueDecoder
-
decodeDecimal
public <T> T decodeDecimal(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeDecimal在接口中ValueDecoder
-
decodeByteArray
public <T> T decodeByteArray(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)- 指定者:
decodeByteArray在接口中ValueDecoder
-
decodeBit
public <T> T decodeBit(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeBit在接口中ValueDecoder
-
decodeSet
public <T> T decodeSet(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)- 指定者:
decodeSet在接口中ValueDecoder
-
decodeYear
public <T> T decodeYear(byte[] bytes, int offset, int length, ValueFactory<T> vf)- 指定者:
decodeYear在接口中ValueDecoder
-
getInt
public static int getInt(byte[] buf, int offset, int endpos) throws NumberFormatException
-
getLong
public static long getLong(byte[] buf, int offset, int endpos) throws NumberFormatException
-
getBigInteger
public static BigInteger getBigInteger(byte[] buf, int offset, int length) throws NumberFormatException
-
getDouble
public static Double getDouble(byte[] bytes, int offset, int length)
-
isDate
public static boolean isDate(String s)
-
isTime
public static boolean isTime(String s)
-
isTimestamp
public static boolean isTimestamp(String s)
-
getDate
public static InternalDate getDate(byte[] bytes, int offset, int length)
-
getTime
public static InternalTime getTime(byte[] bytes, int offset, int length, int scale)
-
getTimestamp
public static InternalTimestamp getTimestamp(byte[] bytes, int offset, int length, int scale)
-
-