use of io.mycat.backend.mysql.MySQLMessage in project Mycat-Server by MyCATApache.
the class AuthPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
clientFlags = mm.readUB4();
maxPacketSize = mm.readUB4();
charsetIndex = (mm.read() & 0xff);
// read extra
int current = mm.position();
int len = (int) mm.readLength();
if (len > 0 && len < FILLER.length) {
byte[] ab = new byte[len];
System.arraycopy(mm.bytes(), mm.position(), ab, 0, len);
this.extra = ab;
}
mm.position(current + FILLER.length);
user = mm.readStringWithNull();
password = mm.readBytesWithLength();
if (((clientFlags & Capabilities.CLIENT_CONNECT_WITH_DB) != 0) && mm.hasRemaining()) {
database = mm.readStringWithNull();
}
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat-Server by MyCATApache.
the class FieldPacket method read.
/**
* 把BinaryPacket转变成FieldPacket
*/
public void read(BinaryPacket bin) {
this.packetLength = bin.packetLength;
this.packetId = bin.packetId;
readBody(new MySQLMessage(bin.data));
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat-Server by MyCATApache.
the class FieldPacket method read.
/**
* 把字节数组转变成FieldPacket
*/
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
this.packetLength = mm.readUB3();
this.packetId = mm.read();
readBody(mm);
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat-Server by MyCATApache.
the class OkPacket method read.
public void read(byte[] data) {
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
fieldCount = mm.read();
affectedRows = mm.readLength();
insertId = mm.readLength();
serverStatus = mm.readUB2();
warningCount = mm.readUB2();
if (mm.hasRemaining()) {
this.message = mm.readBytesWithLength();
}
}
use of io.mycat.backend.mysql.MySQLMessage in project Mycat-Server by MyCATApache.
the class RowDataPacket method read.
public void read(byte[] data) {
value = data;
MySQLMessage mm = new MySQLMessage(data);
packetLength = mm.readUB3();
packetId = mm.read();
for (int i = 0; i < fieldCount; i++) {
fieldValues.add(mm.readBytesWithLength());
}
}
Aggregations