public abstract class FastBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
buffersCount
缓冲数
|
protected int |
currentBufferIndex
当前缓冲索引
|
protected int |
minChunkLen
一个缓冲区的最小字节数
|
protected int |
offset
当前缓冲偏移量
|
protected int |
size
缓冲字节数
|
Constructor and Description |
---|
FastBuffer(int size)
构造
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
ensureCapacity(int capacity)
检查现有缓冲区是否满足capacity,不满足则分配新的区域分配下一个缓冲区,不会小于1024
|
int |
index()
当前缓冲位于缓冲区的索引位
|
boolean |
isEmpty()
是否为空
|
int |
length()
获取缓冲总长度
|
int |
offset()
获取当前缓冲偏移量
|
void |
reset()
复位缓冲
|
protected final int minChunkLen
protected int buffersCount
protected int currentBufferIndex
protected int offset
protected int size
public int index()
currentBufferIndex
public int offset()
public void reset()
public int length()
public boolean isEmpty()
protected abstract void ensureCapacity(int capacity)
capacity
- 理想缓冲区字节数Copyright © 2025. All rights reserved.