Package com.google.code.or.net.impl.packet

Examples of com.google.code.or.net.impl.packet.RawPacket


    s.writeInt(20, 1); // the length of the SHA1 encrypted password
    s.writeBytes(MySQLUtils.password41OrLater(this.password.getBytes(this.encoding), ctx.getScramble().getBytes(this.encoding)));
    if(this.initialSchema != null) s.writeNullTerminatedString(StringColumn.valueOf(this.initialSchema.getBytes(this.encoding)));
   
    //
    final RawPacket request = new RawPacket();
    request.setSequence(1);
    request.setPacketBody(s.toByteArray());
    request.setLength(request.getPacketBody().length);
    transport.getOutputStream().writePacket(request);
    transport.getOutputStream().flush();
   
    //
    final Packet response = transport.getInputStream().readPacket();
View Full Code Here


    s.writeInt(20, 1); // the length of the SHA1 encrypted password
    s.writeBytes(MySQLUtils.password41OrLater(this.password.getBytes(this.encoding), ctx.getScramble().getBytes(this.encoding)));
    if(this.initialSchema != null) s.writeNullTerminatedString(StringColumn.valueOf(this.initialSchema.getBytes(this.encoding)));
   
    //
    final RawPacket request = new RawPacket();
    request.setSequence(1);
    request.setPacketBody(s.toByteArray());
    request.setLength(request.getPacketBody().length);
    transport.getOutputStream().writePacket(request);
    transport.getOutputStream().flush();
   
    //
    final Packet response = transport.getInputStream().readPacket();
View Full Code Here

  /**
   *
   */
  public Packet readPacket() throws IOException {
    //
    final RawPacket r = new RawPacket();
    r.setLength(readInt(3));
    r.setSequence(readInt(1));
   
    //
    int total = 0;
    final byte[] body = new byte[r.getLength()];
    while(total < body.length) {
      total += this.read(body, total, body.length - total);
    }
    r.setPacketBody(body);
    return r;
  }
View Full Code Here

TOP

Related Classes of com.google.code.or.net.impl.packet.RawPacket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.