code: public static int expectWS(final Buffer buffer) throws SipParseException {
          int consumed = 0;
          try {
              if (buffer.hasReadableBytes()) {
                  final byte b = buffer.getByte(buffer.getReaderIndex());
                  if (b == SP || b == HTAB) {
                      // ok, it was a WS so consume the byte
                      buffer.readByte();
                      ++consumed;
                  } else {
                      throw new SipParseException(buffer.getReaderIndex(), "Expected WS");
                  }
              } else {
                  throw new SipParseException(buffer.getReaderIndex(),
                          "Expected WS but nothing more to read in the buffer");
              }
          } catch (final IOException e) {
              throw new SipParseException(buffer.getReaderIndex(), UNABLE_TO_READ_FROM_STREAM, e);
          }
          return consumed;
      }
docs: Expect the next byte to be a white space
  
  @param buffer