code: public static void expect(final Buffer buffer, final byte expected) throws SipParseException, IOException {
          final byte actual = buffer.readByte();
          if (actual != expected) {
              final String actualStr = new String(new byte[] { actual }, Charset.forName("UTF-8"));
              final String expectedStr = new String(new byte[] { expected });
              throw new SipParseException(buffer.getReaderIndex(), "Expected '" + expected + "' (" + expectedStr
                      + ") got '" + actual + "' (" + actualStr + ")");
          }
      }
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 buffer that contains the expected byte (note, it is 1
  byte, not bytes)
  @throws ParseException
  in case the expected byte is not the next byte in the buffer