question: static String decodeString ( ByteBuffer buffer , String charset ) { if ( buffer == null ) { return null ; } if ( charset == null ) { throw new IllegalArgumentException ( "charset" ) ; } try { return new String ( buffer . array ( ) , buffer . position ( ) , buffer . limit ( ) - buffer . position ( ) , charset ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } }
target:  Convert the bytes in a given buffer to a string, using a given charset.