posts - 12, comments - 0, trackbacks - 0, articles - 7
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          abstract class Buffer

          Posted on 2011-12-31 11:13 cooperzh 閱讀(176) 評論(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而變為負數


          主站蜘蛛池模板: 阳谷县| 漳州市| 凤凰县| 永兴县| 金湖县| 荔波县| 博客| 庆元县| 珠海市| 西畴县| 石棉县| 彩票| 聂拉木县| 合作市| 措勤县| 佛山市| 凤山县| 嘉禾县| 泰宁县| 阿城市| 江阴市| 石家庄市| 叶城县| 始兴县| 杭锦后旗| 乌什县| 通渭县| 平阳县| 黎平县| 正蓝旗| 云浮市| 怀安县| 镇平县| 勐海县| 紫阳县| 长治市| 镇宁| 太原市| 额济纳旗| 河南省| 德清县|