code: public static int consumeLWS(final Buffer buffer) throws SipParseException {
          final int i = buffer.getReaderIndex();
          consumeWS(buffer);
  
          // if we consume a CRLF we expect at least ONE WS to be present next
          if (consumeCRLF(buffer) > 0) {
              expectWS(buffer);
          }
          consumeWS(buffer);
          if (buffer.getReaderIndex() == i) {
              throw new SipParseException(i, "Expected at least 1 WSP");
          }
          return buffer.getReaderIndex() - i;
      }
docs: Consume linear whitespace (LWS), which according to RFC3261 section 25.1
  Basic Rules is:
  
  LWS = [*WSP CRLF] 1*WSP ; linear whitespace
  
  @param buffer
  @return the number of bytes consumed