public class FastCharBuffer extends FastBuffer implements CharSequence, Appendable
buffersCount, currentBufferIndex, minChunkLen, offset, size| Constructor and Description |
|---|
FastCharBuffer()
构造
|
FastCharBuffer(int size)
构造
|
| Modifier and Type | Method and Description |
|---|---|
FastCharBuffer |
append(char element)
向快速缓冲加入一个字节
|
FastCharBuffer |
append(char[] array)
向快速缓冲加入数据
|
FastCharBuffer |
append(char[] array,
int off,
int len)
向快速缓冲加入数据
|
FastCharBuffer |
append(CharSequence csq) |
FastCharBuffer |
append(CharSequence csq,
int start,
int end)
Appends character sequence to buffer.
|
FastCharBuffer |
append(FastCharBuffer buff)
将另一个快速缓冲加入到自身
|
FastCharBuffer |
append(String string)
追加字符串
|
char[] |
array(int index)
根据索引位返回缓冲集中的缓冲
|
char |
charAt(int index) |
protected void |
ensureCapacity(int capacity)
检查现有缓冲区是否满足capacity,不满足则分配新的区域分配下一个缓冲区,不会小于1024
|
char |
get(int index)
根据索引位返回一个字节
|
void |
reset()
复位缓冲
|
CharSequence |
subSequence(int start,
int end) |
char[] |
toArray()
返回快速缓冲中的数据
|
char[] |
toArray(int start,
int len)
返回快速缓冲中的数据
|
char[] |
toArrayZeroCopyIfPossible()
返回快速缓冲中的数据,如果缓冲区中的数据长度固定,则直接返回原始数组
注意此方法共享数组,不能修改数组内容! |
String |
toString() |
index, isEmpty, length, offsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePoints, lengthpublic FastCharBuffer()
public FastCharBuffer(int size)
size - 一个缓冲区的最小字节数public FastCharBuffer append(char[] array, int off, int len)
array - 数据off - 偏移量len - 字节数public FastCharBuffer append(char[] array)
array - 数据public FastCharBuffer append(char element)
append in interface Appendableelement - 一个字节的数据public FastCharBuffer append(FastCharBuffer buff)
buff - 快速缓冲public char[] array(int index)
index - 索引位public void reset()
FastBufferreset in class FastBufferpublic char[] toArrayZeroCopyIfPossible()
public char[] toArray()
public char[] toArray(int start,
int len)
start - 逻辑起始位置len - 逻辑字节长public char get(int index)
index - 索引位public String toString()
toString in interface CharSequencetoString in class Objectpublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic FastCharBuffer append(CharSequence csq)
append in interface Appendablepublic FastCharBuffer append(CharSequence csq, int start, int end)
append in interface Appendablepublic FastCharBuffer append(String string)
string - Stringprotected void ensureCapacity(int capacity)
FastBufferensureCapacity in class FastBuffercapacity - 理想缓冲区字节数Copyright © 2025. All rights reserved.