public static int consumeCRLF ( final Buffer buffer ) throws SipParseException { try { buffer . markReaderIndex ( ) ; final byte cr = buffer . readByte ( ) ; final byte lf = buffer . readByte ( ) ; if ( cr == CR && lf == LF ) { return 2 ; } } catch ( final IndexOutOfBoundsException e ) { // fall through } catch ( final IOException e ) { throw new SipParseException ( buffer . getReaderIndex ( ) , UNABLE_TO_READ_FROM_STREAM , e ) ; } buffer . resetReaderIndex ( ) ; return 0 ; }
Consume CR + LF