public static String byteArrayToString ( byte [ ] b ) { final int l = b . length / 2 ; if ( l * 2 != b . length ) throw new IllegalArgumentException ( ) ; StringBuffer result = new StringBuffer ( l ) ; int o = 0 ; for ( int i = 0 ; i < l ; i ++ ) { int i1 = b [ o ++ ] & 0xff ; int i2 = b [ o ++ ] & 0xff ; i2 = i2 << 8 ; i1 = i1 | i2 ; result . append ( ( char ) i1 ) ; } return ( result . toString ( ) ) ; }
Converts a double byte array to a string .