protected void write ( OutputStream outputStream , String data , boolean terminate , int level ) { try { if ( data != null ) { if ( level > 0 ) { outputStream . write ( StringUtils . repeat ( " " , level ) . getBytes ( CS_UTF8 ) ) ; } outputStream . write ( data . getBytes ( CS_UTF8 ) ) ; if ( terminate ) { outputStream . write ( "\n" . getBytes ( ) ) ; } } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Write data to the output stream with the specified formatting .