Posted on 2011-12-31 11:13 
cooperzh 阅读(182) 
评论(0)  编辑  收藏  所属分类: 
java.nio.*; 、
public 、
类 
			
			
		 
		java.nio.buffer
public final 方法
     - capacity()
 
     - position()
 
     - postition(int)
 
     - limit()
 
     - limit(int)
 
     - mark()
 
     - reset()
 
     - clear()
 
     - flip()
 
     - rewind()
 
     - remaining()
 
     - hasremaining()
      
总结:这些是Buffer作为容器的基本特征,与内部放的内容无关
public abstract 方法
     - isReadOnly()
 
     - hasArray()
 
     - array()
 
     - arrayOffset()
 
     - isDirect()
     
      
这些方法等待子类进行覆写
protected final 方法
     - nextGetIndex()
 
     - nextGetIndex(int)
 
     - nextPutIndex()
 
     - nextPutIndex(int)
 
     - checkIndex(int)
 
     - checkIndex(int,int)
 
     - markValue()
 
总结:这些方法仅供子类内部使用
protected 方法
checkBounds(int off, int len, int size);
判断是否同时存在:off>=0, len>=0, (off+len)>=size,不存在则报IndexOutOfBoundsException异常
实际上还要同时保证(off+len)不能超过Integer.MAX_VALUE而变为负数