Package com.google.code.or.io.util

Examples of com.google.code.or.io.util.XSerializer.writeInt()


    final XSerializer s = new XSerializer(64);
    s.writeInt(this.packetMarker, 1);
    s.writeUnsignedLong(this.affectedRows);
    s.writeUnsignedLong(this.insertId);
    s.writeInt(this.serverStatus, 2);
    s.writeInt(this.warningCount, 2);
    if(this.message != null) s.writeFixedLengthString(this.message);
    return s.toByteArray();
  }
 
  /**
 
View Full Code Here


  /**
   *
   */
  public byte[] getPacketBody() {
    final XSerializer s = new XSerializer(64);
    s.writeInt(this.packetMarker, 1);
    s.writeInt(this.errorCode, 2);
    s.writeFixedLengthString(this.slash);
    s.writeFixedLengthString(this.sqlState);
    s.writeFixedLengthString(this.errorMessage);
    return s.toByteArray();
View Full Code Here

   *
   */
  public byte[] getPacketBody() {
    final XSerializer s = new XSerializer(64);
    s.writeInt(this.packetMarker, 1);
    s.writeInt(this.errorCode, 2);
    s.writeFixedLengthString(this.slash);
    s.writeFixedLengthString(this.sqlState);
    s.writeFixedLengthString(this.errorMessage);
    return s.toByteArray();
  }
View Full Code Here

    final TransportContext ctx = transport.getContext();
    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    s.writeInt(20, 1); // the length of the SHA1 encrypted password
View Full Code Here

    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    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)));
View Full Code Here

   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    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)));
View Full Code Here

    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    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();
View Full Code Here

  public StringColumn readNullTerminatedString() throws IOException {
    final XSerializer s = new XSerializer(128); // 128 should be OK for most schema names
    while(true) {
      final int v = this.read();
      if(v == 0) break;
      s.writeInt(v, 1);
    }
    return StringColumn.valueOf(s.toByteArray());
  }
 
  public StringColumn readFixedLengthString(final int length) throws IOException {
View Full Code Here

    final TransportContext ctx = transport.getContext();
    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    s.writeInt(20, 1); // the length of the SHA1 encrypted password
View Full Code Here

    LOGGER.info("start to login, user: {}, host: {}, port: {}", new Object[]{this.user, ctx.getServerHost(), ctx.getServerPort()});
   
    //
    final XSerializer s = new XSerializer(64);
    s.writeInt(buildClientCapabilities(), 4);
    s.writeInt(this.maximumPacketLength, 4);
    s.writeInt(this.clientCollation > 0 ? this.clientCollation : ctx.getServerCollation(), 1);
    s.writeBytes((byte)0, 23); // Fixed, all 0
    s.writeNullTerminatedString(StringColumn.valueOf(this.user.getBytes(this.encoding)));
    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)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.