code: public static void expect(final Buffer buffer, final char ch) throws SipParseException {
          try {
              final int i = buffer.readUnsignedByte();
              if (i != ch) {
                  throw new SipParseException(buffer.getReaderIndex(), "Expected '" + ch + "' got '" + i + "'");
              }
          } catch (final IOException e) {
              throw new SipParseException(buffer.getReaderIndex(), UNABLE_TO_READ_FROM_STREAM, e);
          }
      }
docs: Check so that the next byte in the passed in buffer is the expected one.
  
  @param buffer
  the buffer that we will check.
  @param expected
  the expected char
  @throws SipParseException
  in case the expected char is not the next char in the buffer
  or if there is an error reading from the underlying stream