improved buffer allocation, renamed variables, documented code and fixed potential threading issue in SSLSocketChannel2#processHandshake (#154)