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

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


   */
  public byte[] getPacketBody() throws IOException {
    final XSerializer ps = new XSerializer();
    ps.writeInt(this.command, 1);
    ps.writeFixedLengthString(this.databaseName);
    return ps.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here


   */
  public byte[] getPacketBody() throws IOException {
    final XSerializer ps = new XSerializer();
    ps.writeInt(this.command, 1);
    ps.writeFixedLengthString(this.sql);
    return ps.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

    s.writeInt(this.fieldType, 1);
    s.writeInt(this.fieldOptions, 2);
    s.writeInt(this.decimalPrecision, 1);
    s.writeInt(this.reserved, 2);
    if(this.defaultValue != null) s.writeLengthCodedString(this.defaultValue);
    return s.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

    ps.writeInt(this.command, 1);
    ps.writeLong(this.binlogPosition, 4);
    ps.writeInt(this.binlogFlag, 2);
    ps.writeLong(this.serverId, 4);
    ps.writeFixedLengthString(this.binlogFileName);
    return ps.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

    s.writeInt(this.serverCollation, 1);
    s.writeInt(this.serverStatus, 2);
    s.writeInt(0, 13);
    s.writeNullTerminatedString(this.scramble2);
    s.writeNullTerminatedString(this.pluginProvidedData);
    return s.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

  public byte[] getPacketBody() {
    final XSerializer s = new XSerializer(32);
    s.writeInt(this.packetMarker, 1);
    s.writeInt(this.warningCount, 2);
    s.writeInt(this.serverStatus, 2);
    return s.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

  public byte[] getPacketBody() {
    final XSerializer s = new XSerializer(1024);
    for(StringColumn column : this.columns) {
      s.writeLengthCodedString(column);
    }
    return s.toByteArray();
  }
 
  /**
   *
   */
 
View Full Code Here

    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

    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

    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();
   
    //
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.