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);
        }
    }
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.

@param outputStream The output stream.
@param data The data to write.
@param terminate If true, add a line terminator.
@param level The indent level.