Java CharBuffer nextEquals(final CharBuffer buffer, final char next)

Here you can find the source of nextEquals(final CharBuffer buffer, final char next)

Description

next Equals

License

Open Source License

Declaration

private static boolean nextEquals(final CharBuffer buffer, final char next) 

Method Source Code

//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;
    }
}

Related

  1. consume(CharBuffer buf, boolean trim)
  2. convertCharBufferToArray(java.nio.CharBuffer buf)
  3. eraseCharBuffer(CharBuffer buffer)
  4. extendBuffer(CharBuffer buffer, int size)
  5. getCharsFromBufferAndReset(CharBuffer buffer)
  6. printBuffer(CharBuffer charBuffer)
  7. printCharBuffer(CharBuffer msg)
  8. put(char c, CharBuffer buffer)
  9. searchNewline(CharBuffer buffer, int from)