question: private static String createString ( byte data [ ] ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < data . length ; i ++ ) { if ( data [ i ] == 0 ) { break ; } sb . append ( ( char ) data [ i ] ) ; } String result = sb . toString ( ) ; return result ; }
target:  Converts the given byte array into a String. The characters of the given data are connected to a String, until a  terminating '\0' character is encountered.