public class ArrayBuffer<E> extends Buffer<E,ArrayBuffer<E>>
| 构造器和说明 |
|---|
ArrayBuffer(E[] buf) |
ArrayBuffer(E[] buf,
int offset) |
ArrayBuffer(E[] buf,
int offset,
int length)
把指定的数组 包装为 ArrayBuffer,从 offset开始,包装长度为 length
|
ArrayBuffer(int maxCapacity) |
ArrayBuffer(int mark,
int pos,
int lim,
int cap,
E[] buf,
int offset) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
array()
Returns the array that backs this
buffer (optional operation).
|
int |
arrayOffset()
Returns the offset within this buffer's backing array of the first
element of the buffer (optional operation).
|
E |
get() |
E |
get(int index) |
List<E> |
get(int index,
int maxlength) |
boolean |
hasArray()
Tells whether or not this buffer is backed by an accessible
array.
|
boolean |
isReadOnly()
Tells whether or not this buffer is read-only.
|
ArrayBuffer<E> |
put(E e) |
ArrayBuffer<E> |
put(int index,
E e) |
capacity, checkIndex, clear, flip, hasRemaining, limit, limit, mark, nextGetIndex, position, position, remaining, reset, rewindpublic ArrayBuffer(int maxCapacity)
public ArrayBuffer(E[] buf)
public ArrayBuffer(E[] buf, int offset)
public ArrayBuffer(E[] buf, int offset, int length)
buf - public ArrayBuffer(int mark,
int pos,
int lim,
int cap,
E[] buf,
int offset)
public boolean isReadOnly()
BufferisReadOnly 在类中 Buffer<E,ArrayBuffer<E>>public boolean hasArray()
Buffer If this method returns true then the array
and arrayOffset methods may safely be invoked.
hasArray 在类中 Buffer<E,ArrayBuffer<E>>public Object array()
BufferThis method is intended to allow array-backed buffers to be passed to native code more efficiently. Concrete subclasses provide more strongly-typed return values for this method.
Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.
Invoke the hasArray method before invoking this
method in order to ensure that this buffer has an accessible backing
array.
array 在类中 Buffer<E,ArrayBuffer<E>>public int arrayOffset()
BufferIf this buffer is backed by an array then buffer position p corresponds to array index p + arrayOffset().
Invoke the hasArray method before invoking this
method in order to ensure that this buffer has an accessible backing
array.
arrayOffset 在类中 Buffer<E,ArrayBuffer<E>>public ArrayBuffer<E> put(@Nullable E e)
put 在类中 Buffer<E,ArrayBuffer<E>>public ArrayBuffer<E> put(int index, @Nullable E e)
put 在类中 Buffer<E,ArrayBuffer<E>>public E get(int index)
Copyright © 2021. All rights reserved.