Top Description Fields Constructors Methods
com.mysql.cj.protocol.a

public Class MysqlTextValueDecoder

extends Object
implements ValueDecoder
Class Inheritance
All Implemented Interfaces
com.mysql.cj.protocol.ValueDecoder
Imports
java.math.BigDecimal, .BigInteger, java.util.regex.Matcher, .Pattern, com.mysql.cj.Messages, com.mysql.cj.exceptions.DataReadException, .NumberOutOfRange, com.mysql.cj.protocol.InternalDate, .InternalTime, .InternalTimestamp, .ValueDecoder, com.mysql.cj.result.Field, .ValueFactory, com.mysql.cj.util.StringUtils

Implementation of com.mysql.cj.protocol.ValueDecoder for 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).

Field Summary

Modifier and TypeField and Description
public static final int
DATE_BUF_LEN

Buffer length of MySQL date string: 'YYYY-MM-DD'.

public static final Pattern
public static final int
MAX_SIGNED_LONG_LEN

Max string length of a signed long = 9223372036854775807 (19+1 for minus sign)

public static final Pattern
public static final int
TIME_STR_LEN_MAX_NO_FRAC

Max string length of MySQL time string (with microseconds): '-HHH:MM:SS'.

public static final int
TIME_STR_LEN_MAX_WITH_MICROS

Max string length of MySQL time string (with microseconds): '-HHH:MM:SS.mmmmmm'.

public static final int
TIME_STR_LEN_MIN

Min string length of MySQL time string: 'HH:MM:SS'.

public static final int
TIMESTAMP_STR_LEN_NO_FRAC

String length of MySQL timestamp string (no microseconds): 'YYYY-MM-DD HH:MM:SS'.

public static final int
TIMESTAMP_STR_LEN_WITH_MICROS

Max string length of MySQL timestamp (with microsecs): 'YYYY-MM-DD HH:MM:SS.mmmmmm'.

public static final int
TIMESTAMP_STR_LEN_WITH_NANOS

String length of String timestamp with nanos.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
decodeBit(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeBit.

public <T> T
decodeByteArray(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeByteArray.

public <T> T
decodeDate(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDate.

public <T> T
decodeDatetime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDatetime.

public <T> T
decodeDecimal(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDecimal.

public <T> T
decodeDouble(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDouble.

public <T> T
decodeFloat(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeFloat.

public <T> T
decodeInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt1.

public <T> T
decodeInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt2.

public <T> T
decodeInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt4.

public <T> T
decodeInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt8.

public <T> T
decodeSet(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeSet.

public <T> T
decodeTime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeTime.

public <T> T
decodeTimestamp(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeTimestamp.

public <T> T
decodeUInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt1.

public <T> T
decodeUInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt2.

public <T> T
decodeUInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt4.

public <T> T
decodeUInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt8.

public <T> T
decodeYear(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeYear.

public static BigInteger
getBigInteger(byte[] buf, int offset, int length)

public static InternalDate
getDate(byte[] bytes, int offset, int length)

public static Double
getDouble(byte[] bytes, int offset, int length)

public static int
getInt(byte[] buf, int offset, int endpos)

public static long
getLong(byte[] buf, int offset, int endpos)

public static InternalTime
getTime(byte[] bytes, int offset, int length, int scale)

public static InternalTimestamp
getTimestamp(byte[] bytes, int offset, int length, int scale)

public static boolean
public static boolean
public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DATE_BUF_LENback to summary
public static final int DATE_BUF_LEN

Buffer length of MySQL date string: 'YYYY-MM-DD'.

DATETIME_PTRNback to summary
public static final Pattern DATETIME_PTRN
MAX_SIGNED_LONG_LENback to summary
public static final int MAX_SIGNED_LONG_LEN

Max string length of a signed long = 9223372036854775807 (19+1 for minus sign)

TIME_PTRNback to summary
public static final Pattern TIME_PTRN
TIME_STR_LEN_MAX_NO_FRACback to summary
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_MICROSback to summary
public static final int TIME_STR_LEN_MAX_WITH_MICROS

Max string length of MySQL time string (with microseconds): '-HHH:MM:SS.mmmmmm'.

TIME_STR_LEN_MINback to summary
public static final int TIME_STR_LEN_MIN

Min string length of MySQL time string: 'HH:MM:SS'.

TIMESTAMP_STR_LEN_NO_FRACback to summary
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_MICROSback to summary
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_NANOSback to summary
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.

Constructor Detail

MysqlTextValueDecoderback to summary
public MysqlTextValueDecoder()

Method Detail

decodeBitback to summary
public <T> T decodeBit(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeBit.

Annotations
@Override
decodeByteArrayback to summary
public <T> T decodeByteArray(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeByteArray.

Annotations
@Override
decodeDateback to summary
public <T> T decodeDate(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDate.

Annotations
@Override
decodeDatetimeback to summary
public <T> T decodeDatetime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDatetime.

Annotations
@Override
decodeDecimalback to summary
public <T> T decodeDecimal(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDecimal.

Annotations
@Override
decodeDoubleback to summary
public <T> T decodeDouble(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeDouble.

Annotations
@Override
decodeFloatback to summary
public <T> T decodeFloat(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeFloat.

Annotations
@Override
decodeInt1back to summary
public <T> T decodeInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt1.

Annotations
@Override
decodeInt2back to summary
public <T> T decodeInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt2.

Annotations
@Override
decodeInt4back to summary
public <T> T decodeInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt4.

Annotations
@Override
decodeInt8back to summary
public <T> T decodeInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeInt8.

Annotations
@Override
decodeSetback to summary
public <T> T decodeSet(byte[] bytes, int offset, int length, Field f, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeSet.

Annotations
@Override
decodeTimeback to summary
public <T> T decodeTime(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeTime.

Annotations
@Override
decodeTimestampback to summary
public <T> T decodeTimestamp(byte[] bytes, int offset, int length, int scale, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeTimestamp.

Annotations
@Override
decodeUInt1back to summary
public <T> T decodeUInt1(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt1.

Annotations
@Override
decodeUInt2back to summary
public <T> T decodeUInt2(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt2.

Annotations
@Override
decodeUInt4back to summary
public <T> T decodeUInt4(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt4.

Annotations
@Override
decodeUInt8back to summary
public <T> T decodeUInt8(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeUInt8.

Annotations
@Override
decodeYearback to summary
public <T> T decodeYear(byte[] bytes, int offset, int length, ValueFactory<T> vf)

Implements com.mysql.cj.protocol.ValueDecoder.decodeYear.

Annotations
@Override
getBigIntegerback to summary
public static BigInteger getBigInteger(byte[] buf, int offset, int length) throws NumberFormatException
getDateback to summary
public static InternalDate getDate(byte[] bytes, int offset, int length)
getDoubleback to summary
public static Double getDouble(byte[] bytes, int offset, int length)
getIntback to summary
public static int getInt(byte[] buf, int offset, int endpos) throws NumberFormatException
getLongback to summary
public static long getLong(byte[] buf, int offset, int endpos) throws NumberFormatException
getTimeback to summary
public static InternalTime getTime(byte[] bytes, int offset, int length, int scale)
getTimestampback to summary
public static InternalTimestamp getTimestamp(byte[] bytes, int offset, int length, int scale)
isDateback to summary
public static boolean isDate(String s)
isTimeback to summary
public static boolean isTime(String s)
isTimestampback to summary
public static boolean isTimestamp(String s)