public final String getFixString ( final int len , String charsetName ) { if ( position + len > origin + limit ) throw new IllegalArgumentException ( "limit excceed: " + ( position + len - origin ) ) ; final int from = position ; final int end = from + len ; byte [ ] buf = buffer ; int found = from ; for ( ; ( found < end ) && buf [ found ] != ' ' ; found ++ ) /* empty loop */ ; try { String string = new String ( buf , from , found - from , charsetName ) ; position += len ; return string ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( "Unsupported encoding: " + charsetName , e ) ; } }
Return next fix length string from buffer .