List of usage examples for java.nio CharBuffer mark
public final Buffer mark()
reset()
. From source file:MainClass.java
private static void symmetricScramble(CharBuffer buffer) { while (buffer.hasRemaining()) { buffer.mark(); char c1 = buffer.get(); char c2 = buffer.get(); buffer.reset();/*from w w w .ja va 2 s . c o m*/ buffer.put(c2).put(c1); } }