zoukankan      html  css  js  c++  java
  • NIO中的Buffer

    public abstract class Buffer {
    
        // Invariants: mark <= position <= limit <= capacity
        private int mark = -1;
        private int position = 0;
        private int limit;
        private int capacity;
    
        // Used only by direct buffers
        // NOTE: hoisted here for speed in JNI GetDirectBufferAddress
        long address;
       ......

    clear

     public final Buffer clear() {
            position = 0;
            limit = capacity;
            mark = -1;
            return this;
        }

    flip

     public final Buffer flip() {
            limit = position;
            position = 0;
            mark = -1;
            return this;
        }

    rewind

    public final Buffer rewind() {
            position = 0;
            mark = -1;
            return this;
        }
  • 相关阅读:
    9.4
    9.3
    9.2
    2016.9.1
    html,body
    prototype
    京东笔试题的一些小细节
    gulp安装过程中的问题。
    json
    双飞翼布局和圣杯布局
  • 原文地址:https://www.cnblogs.com/vayci/p/7110150.html
Copyright © 2011-2022 走看看