@ SuppressWarnings ( "unused" ) private void saveClassfileBufferForDebugging ( String className , byte [ ] classfileBuffer ) { try { if ( className . contains ( "CX" ) ) { java . io . DataOutputStream tmpout = new java . io . DataOutputStream ( new java . io . FileOutputStream ( "out" ) ) ; tmpout . write ( classfileBuffer , 0 , classfileBuffer . length ) ; tmpout . close ( ) ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } }
This method is for debugging purposes . So far one of the best way to debug instrumentation was to actually look at the instrumented code . This method let us choose which class to print .