public Symm obtain ( byte [ ] key ) throws IOException { try { byte [ ] bytes = new byte [ AES . AES_KEY_SIZE / 8 ] ; int offset = ( Math . abs ( key [ ( 47 % key . length ) ] ) + 137 ) % ( key . length - bytes . length ) ; for ( int i = 0 ; i < bytes . length ; ++ i ) { bytes [ i ] = key [ i + offset ] ; } aes = new AES ( bytes , 0 , bytes . length ) ; } catch ( Exception e ) { throw new IOException ( e ) ; } int filled = codeset . length ; char [ ] seq = new char [ filled ] ; int end = filled -- ; boolean right = true ; int index ; Obtain o = new Obtain ( this , key ) ; while ( filled >= 0 ) { index = o . next ( ) ; if ( index < 0 || index >= codeset . length ) { System . out . println ( "uh, oh" ) ; } if ( right ) { // alternate going left or right to find the next open slot (keeps it from taking too long to hit something) for ( int j = index ; j < end ; ++ j ) { if ( seq [ j ] == 0 ) { seq [ j ] = codeset [ filled ] ; -- filled ; break ; } } right = false ; } else { for ( int j = index ; j >= 0 ; -- j ) { if ( seq [ j ] == 0 ) { seq [ j ] = codeset [ filled ] ; -- filled ; break ; } } right = true ; } } return new Symm ( seq , this ) ; }
quick recreation when the official stream is actually obtained .