public final String getString ( final int pos , String charsetName ) { if ( pos >= limit || pos < 0 ) throw new IllegalArgumentException ( "limit excceed: " + pos ) ; byte [ ] buf = buffer ; final int len = ( 0xff & buf [ origin + pos ] ) ; if ( pos + len + 1 > limit ) throw new IllegalArgumentException ( "limit excceed: " + ( pos + len + 1 ) ) ; try { return new String ( buf , origin + pos + 1 , len , charsetName ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( "Unsupported encoding: " + charsetName , e ) ; } }
Return dynamic length string from buffer .