private void send(ByteBuffer buffer) throws IOException {
        if (sslChannel != null) {
            sslChannel.write(buffer);
        } else {
            realNetSend(buffer);
        }
        isSend = true;
    }
@Test
    public void testSend() throws IOException {
        // mock
        new Expectations() {
            {
                channel.write((ByteBuffer) any);
                minTimes = 0;
                result = new Delegate() {
                    int fakeWrite(ByteBuffer buffer) {
                        int writeLen = 0;
                        writeLen += buffer.remaining();
                        buffer.position(buffer.limit());
                        return writeLen;
                    }
                };
            }
        };

        MysqlChannel channel1 = new MysqlChannel(channel);
        ByteBuffer buf = ByteBuffer.allocate(1000);
        channel1.sendOnePacket(buf);

        buf = ByteBuffer.allocate(0xffffff0);
        channel1.sendOnePacket(buf);
    }