public final class Segment extends Object
limit及以上 每个字节数组都有一个单独的拥有段 的立场,
限制、prev和next引用不共享| Modifier and Type | Field and Description |
|---|---|
byte[] |
data |
int |
limit
准备写入的可用数据的第一个字节.
|
Segment |
next
链表或循环链表中的下一段.
|
boolean |
owner
如果这个段拥有字节数组并可以向其追加,则为True,扩展
limit. |
int |
pos
此段中要读取的应用程序数据字节的下一个字节.
|
Segment |
prev
循环链表中的前一段.
|
static int |
SHARE_MINIMUM
这样做避免了这么多字节的
arraycopy()时,将被共享 |
boolean |
shared
如果其他段或字节字符串使用相同的字节数组,则为真.
|
static int |
SIZE
所有段的大小(以字节为单位)
|
| Modifier and Type | Method and Description |
|---|---|
void |
compact() |
Segment |
pop() |
Segment |
push(Segment segment) |
Segment |
sharedCopy() |
Segment |
split(int byteCount) |
Segment |
unsharedCopy() |
void |
writeTo(Segment sink,
int byteCount) |
public static final int SIZE
public static final int SHARE_MINIMUM
arraycopy()时,将被共享public final byte[] data
public int pos
public int limit
public boolean shared
public boolean owner
limit.public Segment next
public Segment prev
Copyright © 2020. All rights reserved.