private ByteBuffer allocate(int size) {
        return ByteBuffer.allocate(size);
    }
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