NIO之ByteBuffer

来源:互联网 发布:阿里云邮电脑客户端 编辑:程序博客网 时间:2024/06/11 12:31

0 <= mark <= position  <= limit <= capacity



clear(扩):(position,limit),It sets the limit to the capacity and the position to zero
flip(部分回退,级联): (position,limit) ,It sets the limit to the current position and then sets the position to zero.
reset(部分回退):(position),Resets this buffer's position to the previously-marked position.
rewind(倒带,彻底回退):(position),It leaves the limit unchanged and sets the position to zero
mark:(mark),Sets this buffer's mark at its position.