public void encode(ByteBuffer buffer, @NonNull CodecCallback callback) throws IOException {
        if (!buffer.hasRemaining()) {
            return;
        }
        if (mHandshakeFinished) {
            wrap(createEngine(mSSLEngineFactory), buffer, callback);
        } else {
            mPlaintextBuffers.offer(buffer);
        }
    }
Try to encrypt a plaintext packet. If SSL handshake has finished, then encode it,
otherwise add it to queue and wait handshake finished.

@param buffer The plaintext packet.
@param callback A callback to observe actions and receive output packets.
@throws IOException If an I/O error has occurred.
netbare-core/src/main/java/com/github/megatronking/netbare/ssl/SSLCodec.java