⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bufferflip.java

📁 java nio 编程一个实例子.服务端程序
💻 JAVA
字号:
package com.ronsoft.books.nio.buffers;import java.nio.CharBuffer;/** * 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 $ */public class BufferFlip{	public static void main (String [] argv)		throws Exception	{		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 void println (CharBuffer cb)	{		System.out.println ("pos=" + cb.position() + ", limit="			+ cb.limit() + ": '" + cb + "'");	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -