Ejemplo n.º 1
0
 public void read(byte[] data) {
   MySQLMessage mm = new MySQLMessage(data);
   packetLength = mm.readUB3();
   packetId = mm.read();
   protocolVersion = mm.read();
   serverVersion = mm.readBytesWithNull();
   threadId = mm.readUB4();
   seed = mm.readBytesWithNull();
   serverCapabilities = mm.readUB2();
   serverCharsetIndex = mm.read();
   serverStatus = mm.readUB2();
   mm.move(13);
   restOfScrambleBuff = mm.readBytesWithNull();
 }
Ejemplo n.º 2
0
 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();
   }
 }