import java.nio.ByteBuffer;
import java.nio.CharBuffer;
public class MainClass {
public static void main(String[] args) {
ByteBuffer bb = ByteBuffer.wrap(new byte[] { 0, 0, 0, 0, 0, 0, 0, 'a' });
bb.rewind();
CharBuffer cb = ((ByteBuffer) bb.rewind()).asCharBuffer();
System.out.println("Char Buffer");
while (cb.hasRemaining())
System.out.println(cb.position() + " -> " + cb.get());
}
}