<div> JavaScript is disabled on your browser.
Skip navigation links
Java™ Platform
Standard Ed. 8
compact2

Package java.nio

定义了缓冲区,这是数据的容器,并提供其他NIO包的概述。

See: 描述

Package java.nio Description

定义了缓冲区,这是数据的容器,并提供其他NIO包的概述。

NiO的中央抽象的API:

java.nio包定义的缓冲区类,用于在NIO API。该字符集的API是在java.nio.charset包的定义,和通道选择器API在java.nio.channels包定义。这些子包都有自己的服务提供商(SPI)分装,其内容可扩展平台的默认实现或构建不同的实现。

Buffers

描述

Buffer Position, limit, and capacity;
clear, flip, rewind, and mark/reset
  ByteBuffer Get/put, compact, views; allocate, wrap
    MappedByteBuffer   A byte buffer mapped to a file
  CharBuffer Get/put, compact; allocate, wrap
  DoubleBuffer     ' '
  FloatBuffer     ' '
  IntBuffer     ' '
  LongBuffer     ' '
  ShortBuffer     ' '
ByteOrder Typesafe enumeration for byte orders

一个缓冲区是一个固定数量的一个特定的原始数据类型的容器。除了其内容缓冲区有一个位置,这是下一单元进行读或写的指数,和限制,是不能读或写的第一个元素的索引。基地Buffer类定义了这些属性和方法结算,翻转,和复卷,为标记的当前位置,并复位位置上标记。

对于每个非布尔类型的原始类型都有一个缓冲区。每个类都定义了移动数据不在缓冲区一家得到和放方法,为压实,复制方法,和切片缓冲,和一个新的缓冲区分配以及包装现有数组读入缓冲区的静态方法。

字节缓冲区的区别,因为它们可以作为I / O操作的来源和目标。他们还支持在其他缓冲类中没有找到的几个功能:

除非另有说明,通过null实参构造函数或方法的任何类或接口在这个包会导致NullPointerException被。

从以下版本开始:
1.4
Skip navigation links
Java™ Platform
Standard Ed. 8

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.

本帮助文档是使用 《百度翻译》翻译,请与英文版配合使用 by--QQ:654638585