FileDocCategorySizeDatePackage
BufferFlip.javaAPI DocExample651Tue May 07 19:41:20 BST 2002com.ronsoft.books.nio.buffers

BufferFlip

public class BufferFlip extends Object
Test the effects of buffer flipping.
author
Ron Hitchens (ron@ronsoft.com)
version
$Id: BufferFlip.java,v 1.1 2002/05/08 02:41:20 ron Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		CharBuffer cb = CharBuffer.allocate (15);

		cb.put ("Hello World");
		println (cb);

		cb.flip();
		println (cb);

		cb.flip();
		println (cb);

		cb.flip();
		println (cb);
	
private static voidprintln(java.nio.CharBuffer cb)

		System.out.println ("pos=" + cb.position() + ", limit="
			+ cb.limit() + ": '" + cb + "'");