Here you can find the source of nextEquals(final CharBuffer buffer, final char next)
private static boolean nextEquals(final CharBuffer buffer, final char next)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011, 2012 TH4 SYSTEMS GmbH and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*ww w. j a v a2 s . co m*/ * TH4 SYSTEMS GmbH - initial API and implementation *******************************************************************************/ import java.nio.CharBuffer; public class Main { private static boolean nextEquals(final CharBuffer buffer, final char next) { if (!buffer.hasRemaining()) { return false; } return buffer.get(buffer.position()) == next; } }