private void write ( Symbol symbol , BitWriter bitwriter ) throws JSONException { try { Symbol back = symbol . back ; if ( back != null ) { this . width += 1 ; write ( back , bitwriter ) ; if ( back . zero == symbol ) { bitwriter . zero ( ) ; } else { bitwriter . one ( ) ; } } } catch ( Throwable e ) { throw new JSONException ( e ) ; } }
Recur from a symbol back emitting bits . We recur before emitting to make the bits come out in the right order .