类 CompressedPacketSender

    • 字段详细资料

      • COMP_HEADER_LENGTH

        public static final int COMP_HEADER_LENGTH
        另请参阅:
        常量字段值
      • MIN_COMPRESS_LEN

        public static final int MIN_COMPRESS_LEN
        另请参阅:
        常量字段值
    • 构造器详细资料

    • 方法详细资料

      • stop

        public void stop()
        Shut down this packet sender and deallocate any resources.
      • send

        public void send​(byte[] packet,
                         int packetLen,
                         byte packetSequence)
                  throws IOException
        Packet sender implementation for the compressed MySQL protocol. For compressed transmission of multi-packets, split the packets up in the same way as the uncompressed protocol. We fit up to MAX_PACKET_SIZE bytes of split uncompressed packet, including the header, into an compressed packet. The first packet of the multi-packet is 4 bytes of header and MAX_PACKET_SIZE - 4 bytes of the payload. The next packet must send the remaining four bytes of the payload followed by a new header and payload. If the second split packet is also around MAX_PACKET_SIZE in length, then only MAX_PACKET_SIZE - 4 (from the previous packet) - 4 (for the new header) can be sent. This means the payload will be limited by 8 bytes and this will continue to increase by 4 at every iteration.
        指定者:
        send 在接口中 MessageSender<NativePacketPayload>
        参数:
        packet - data bytes
        packetLen - packet length
        packetSequence - sequence id
        抛出:
        IOException - if i/o exception occurs