public static int [ ] printAnsi ( char ... out ) { int [ ] ansi = new int [ out . length + 2 ] ; ansi [ 0 ] = 27 ; ansi [ 1 ] = ' ' ; int counter = 0 ; for ( char anOut : out ) { if ( anOut == ' ' ) { Arrays . fill ( ansi , counter + 2 , counter + 2 + TAB , ' ' ) ; counter += TAB - 1 ; } else ansi [ counter + 2 ] = anOut ; counter ++ ; } return ansi ; }
Return a ansified string based on param