Class MySQLPacketPayload

java.lang.Object
org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload
All Implemented Interfaces:
AutoCloseable, PacketPayload

public final class MySQLPacketPayload extends Object implements PacketPayload
MySQL payload operation for MySQL packet data types.
See Also:
  • Constructor Details

    • MySQLPacketPayload

      public MySQLPacketPayload()
  • Method Details

    • readInt1

      public int readInt1()
      Read 1 byte fixed length integer from byte buffers.
      Returns:
      1 byte fixed length integer
      See Also:
    • writeInt1

      public void writeInt1(int value)
      Write 1 byte fixed length integer to byte buffers.
      Parameters:
      value - 1 byte fixed length integer
      See Also:
    • readInt2

      public int readInt2()
      Read 2 byte fixed length integer from byte buffers.
      Returns:
      2 byte fixed length integer
      See Also:
    • writeInt2

      public void writeInt2(int value)
      Write 2 byte fixed length integer to byte buffers.
      Parameters:
      value - 2 byte fixed length integer
      See Also:
    • readInt3

      public int readInt3()
      Read 3 byte fixed length integer from byte buffers.
      Returns:
      3 byte fixed length integer
      See Also:
    • writeInt3

      public void writeInt3(int value)
      Write 3 byte fixed length integer to byte buffers.
      Parameters:
      value - 3 byte fixed length integer
      See Also:
    • readInt4

      public int readInt4()
      Read 4 byte fixed length integer from byte buffers.
      Returns:
      4 byte fixed length integer
      See Also:
    • writeInt4

      public void writeInt4(int value)
      Write 4 byte fixed length integer to byte buffers.
      Parameters:
      value - 4 byte fixed length integer
      See Also:
    • readInt6

      public long readInt6()
      Read 6 byte fixed length integer from byte buffers.
      Returns:
      6 byte fixed length integer
      See Also:
    • writeInt6

      public void writeInt6(long value)
      Write 6 byte fixed length integer to byte buffers.
      Parameters:
      value - 6 byte fixed length integer
      See Also:
    • readInt8

      public long readInt8()
      Read 8 byte fixed length integer from byte buffers.
      Returns:
      8 byte fixed length integer
      See Also:
    • writeInt8

      public void writeInt8(long value)
      Write 8 byte fixed length integer to byte buffers.
      Parameters:
      value - 8 byte fixed length integer
      See Also:
    • readIntLenenc

      public long readIntLenenc()
      Read lenenc integer from byte buffers.
      Returns:
      lenenc integer
      See Also:
    • writeIntLenenc

      public void writeIntLenenc(long value)
      Write lenenc integer to byte buffers.
      Parameters:
      value - lenenc integer
      See Also:
    • readLong

      public long readLong(int length)
      Read fixed length long from byte buffers.
      Parameters:
      length - length read from byte buffers
      Returns:
      fixed length long
    • readStringLenenc

      public String readStringLenenc()
      Read lenenc string from byte buffers.
      Returns:
      lenenc string
      See Also:
    • readStringLenencByBytes

      public byte[] readStringLenencByBytes()
      Read lenenc string from byte buffers for bytes.
      Returns:
      lenenc bytes
      See Also:
    • writeStringLenenc

      public void writeStringLenenc(String value)
      Write lenenc string to byte buffers.
      Parameters:
      value - fixed length string
      See Also:
    • writeBytesLenenc

      public void writeBytesLenenc(byte[] value)
      Write lenenc bytes to byte buffers.
      Parameters:
      value - fixed length bytes
    • readStringFix

      public String readStringFix(int length)
      Read fixed length string from byte buffers.
      Parameters:
      length - length of fixed string
      Returns:
      fixed length string
      See Also:
    • readStringFixByBytes

      public byte[] readStringFixByBytes(int length)
      Read fixed length string from byte buffers and return bytes.
      Parameters:
      length - length of fixed string
      Returns:
      fixed length bytes
      See Also:
    • writeStringFix

      public void writeStringFix(String value)
      Write variable length string to byte buffers.
      Parameters:
      value - fixed length string
      See Also:
    • writeBytes

      public void writeBytes(byte[] value)
      Write variable length bytes to byte buffers.
      Parameters:
      value - fixed length bytes
      See Also:
    • readStringVar

      public String readStringVar()
      Read variable length string from byte buffers.
      Returns:
      variable length string
      See Also:
    • writeStringVar

      public void writeStringVar(String value)
      Write fixed length string to byte buffers.
      Parameters:
      value - variable length string
      See Also:
    • readStringNul

      public String readStringNul()
      Read null terminated string from byte buffers.
      Returns:
      null terminated string
      See Also:
    • readStringNulByBytes

      public byte[] readStringNulByBytes()
      Read null terminated string from byte buffers and return bytes.
      Returns:
      null terminated bytes
      See Also:
    • writeStringNul

      public void writeStringNul(String value)
      Write null terminated string to byte buffers.
      Parameters:
      value - null terminated string
      See Also:
    • readStringEOFByBytes

      public byte[] readStringEOFByBytes()
      Read rest of packet string from byte buffers and return bytes.
      Returns:
      rest of packet string bytes
      See Also:
    • readStringEOF

      public String readStringEOF()
      Read rest of packet string from byte buffers.
      Returns:
      rest of packet string
      See Also:
    • writeStringEOF

      public void writeStringEOF(String value)
      Write rest of packet string to byte buffers.
      Parameters:
      value - rest of packet string
      See Also:
    • skipReserved

      public void skipReserved(int length)
      Skip reserved from byte buffers.
      Parameters:
      length - length of reserved
    • writeReserved

      public void writeReserved(int length)
      Write null for reserved to byte buffers.
      Parameters:
      length - length of reserved
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable