public static String readString ( ByteBuffer buffer , int strLen ) { StringBuilder sb = new StringBuilder ( strLen ) ; for ( int i = 0 ; i < strLen ; i ++ ) { sb . append ( buffer . getChar ( ) ) ; } return sb . toString ( ) ; }
read utf16 strings use strLen not ending 0 char .