private void expect()

in folsom/src/main/java/com/spotify/folsom/client/ascii/AsciiMemcacheDecoder.java [264:277]


  private void expect(byte firstChar, final String compareTo) throws IOException {
    if (firstChar != compareTo.charAt(0)) {
      throw fail();
    }
    final int length = compareTo.length();
    if (length != token.remaining() + 1) {
      throw fail();
    }
    for (int i = 1; i < length; i++) {
      if (token.get() != compareTo.charAt(i)) {
        throw fail();
      }
    }
  }