public static final String nextLine ( ByteBuffer buffer ) { if ( buffer == null ) { return null ; } int index = MemcachedDecoder . SPLIT_MATCHER . matchFirst ( com . google . code . yanf4j . buffer . IoBuffer . wrap ( buffer ) ) ; if ( index >= 0 ) { int limit = buffer . limit ( ) ; buffer . limit ( index ) ; byte [ ] bytes = new byte [ buffer . remaining ( ) ] ; buffer . get ( bytes ) ; buffer . limit ( limit ) ; buffer . position ( index + ByteUtils . SPLIT . remaining ( ) ) ; return getString ( bytes ) ; } return null ; }
Read next line from ByteBuffer