@ Override protected void createHandshakeBytes ( ) { log . trace ( "createHandshakeBytes" ) ; BigInteger bi = new BigInteger ( ( Constants . HANDSHAKE_SIZE * 8 ) , random ) ; handshakeBytes = BigIntegers . asUnsignedByteArray ( bi ) ; // prevent AOOB error that can occur, sometimes if ( handshakeBytes . length < Constants . HANDSHAKE_SIZE ) { // resize the handshake bytes ByteBuffer b = ByteBuffer . allocate ( Constants . HANDSHAKE_SIZE ) ; b . put ( handshakeBytes ) ; b . put ( ( byte ) 0x13 ) ; b . flip ( ) ; handshakeBytes = b . array ( ) ; } }
Creates the servers handshake bytes