public class BigByteBuffer extends Buffer<BigByteBuffer>
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MIN_SEGMENT_SIZE |
| 构造器和说明 |
|---|
BigByteBuffer() |
BigByteBuffer(byte[] bytes,
long cap,
int segmentSize) |
BigByteBuffer(int segmentSize) |
BigByteBuffer(long cap) |
BigByteBuffer(long cap,
boolean direct,
int segmentSize) |
BigByteBuffer(long cap,
int segmentSize) |
BigByteBuffer(long mark,
long pos,
long lim,
long cap,
boolean direct,
int segmentSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
array()
Returns the array that backs this
buffer (optional operation).
|
long |
arrayOffset()
Returns the offset within this buffer's backing array of the first
element of the buffer (optional operation).
|
BigByteBuffer |
clear()
Clears this buffer.
|
BigByteBuffer |
flip()
Flips this buffer.
|
byte |
get() |
byte |
get(long index) |
ByteBuffer |
get(long 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.
|
BigByteBuffer |
put(byte b) |
BigByteBuffer |
put(byte[] bytes) |
BigByteBuffer |
put(long index,
byte b) |
BigByteBuffer |
rewind()
Rewinds this buffer.
|
void |
setReadonly(boolean readonly) |
capacity, checkIndex, hasRemaining, limit, limit, mark, nextGetIndex, nextGetIndex, nextPutIndex, position, position, remaining, resetpublic BigByteBuffer()
public BigByteBuffer(int segmentSize)
public BigByteBuffer(byte[] bytes,
long cap,
int segmentSize)
public BigByteBuffer(long cap)
public BigByteBuffer(long cap,
int segmentSize)
public BigByteBuffer(long cap,
boolean direct,
int segmentSize)
public BigByteBuffer(long mark,
long pos,
long lim,
long cap,
boolean direct,
int segmentSize)
public void setReadonly(boolean readonly)
public BigByteBuffer clear()
BufferInvoke this method before using a sequence of channel-read or put operations to fill this buffer. For example:
buf.clear(); // Prepare buffer for reading in.read(buf); // Read data
This method does not actually erase the data in the buffer, but it is named as if it did because it will most often be used in situations in which that might as well be the case.
clear 在类中 Buffer<BigByteBuffer>public BigByteBuffer flip()
BufferAfter a sequence of channel-read or put operations, invoke this method to prepare for a sequence of channel-write or relative get operations. For example:
buf.put(magic); // Prepend header in.read(buf); // Read data into rest of buffer buf.flip(); // Flip buffer out.write(buf); // Write header + data to channel
This method is often used in conjunction with method when transferring data from one place to another.
flip 在类中 Buffer<BigByteBuffer>public BigByteBuffer rewind()
BufferInvoke this method before a sequence of channel-write or get operations, assuming that the limit has already been set appropriately. For example:
out.write(buf); // Write remaining data buf.rewind(); // Rewind buffer buf.get(array); // Copy data into array
rewind 在接口中 Rewindablerewind 在类中 Buffer<BigByteBuffer>public boolean isReadOnly()
BufferisReadOnly 在类中 Buffer<BigByteBuffer>public final boolean hasArray()
Buffer If this method returns true then the array
and arrayOffset methods may safely be invoked.
hasArray 在类中 Buffer<BigByteBuffer>public final 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<BigByteBuffer>public final long 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<BigByteBuffer>public BigByteBuffer put(byte b)
public BigByteBuffer put(byte[] bytes)
public BigByteBuffer put(long index, byte b)
public byte get()
public byte get(long index)
public ByteBuffer get(long index, int maxLength)
Copyright © 2021. All rights reserved.