Java不支持简单类型的collection.需要的时候可用IntBuffer。
public abstract class IntBufferextends Bufferimplements Comparable< IntBuffer>
int 缓冲区。
此类定义了 int 缓冲区上的四类操作:
-
将此缓冲区的连续 int 序列传输到数组中的相对批量 get 方法;
-
将 int 数组或其他 int 缓冲区中的连续 int 序列传输到此缓冲区的相对批量 put 方法;以及
-
int 缓冲区的 compacting、duplicating 和
#slice
slicing 方法。