public class SoftBuffer extends Object
| 构造器和说明 |
|---|
SoftBuffer()
使用默认的大小初始化缓存空间
Initialize cache space with default size
|
SoftBuffer(int capacity)
使用指定的容量初始化缓存数据块
Initialize the cache data block with the specified capacity
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
GetBool(int destIndex)
获取指定的位置的bool值,如果超出,则引发异常
Get the bool value at the specified position, if it exceeds, an exception is thrown
|
boolean[] |
GetBool(int destIndex,
int length)
获取指定位置的bool数组值,如果超过,则引发异常
Get the bool array value at the specified position, if it exceeds, an exception is thrown
|
byte |
GetByte(int index)
获取byte类型的数据
Get byte data
|
byte[] |
GetBytes()
获取内存所有的数据信息
Get all data information in memory
|
byte[] |
GetBytes(int index,
int length)
获取内存指定长度的数据信息
Get data information of specified length in memory
|
IByteTransform |
getByteTransform()
当前的数据变换机制,当你需要从字节数据转换类型数据的时候需要。
|
<T extends IDataTransfer> |
GetCustomer(Class<T> type,
int index)
读取自定义类型的数据,需要规定解析规则
Read custom types of data, need to specify the parsing rules
|
double |
GetDouble(int index)
获取double类型的数据到缓存区
Get double type data to cache
|
double[] |
GetDouble(int index,
int length)
获取double类型的数组到缓存区
Get double type array to cache
|
short |
GetInt16(int index)
获取short类型的数据到缓存区
Get short data to the cache
|
short[] |
GetInt16(int index,
int length)
获取short类型的数组到缓存区
Get short type array to cache
|
int |
GetInt32(int index)
获取int类型的数据到缓存区
Get int type data to cache
|
int[] |
GetInt32(int index,
int length)
获取int类型的数组到缓存区
Get int type array to cache
|
long |
GetInt64(int index)
获取long类型的数据到缓存区
Get long type data to cache
|
long[] |
GetInt64(int index,
int length)
获取long类型的数组到缓存区
Get long type array to cache
|
boolean |
getIsBoolReverseByWord()
获取当前的bool操作是否按照字节反转
|
float |
GetSingle(int index)
获取float类型的数据到缓存区
Get float type data to cache
|
float[] |
GetSingle(int index,
int length)
获取float类型的数组到缓存区
Get float type array to cache
|
void |
SetBool(boolean[] value,
int destIndex)
设置指定的位置的bool数组,如果超出,则丢弃数据,该位置是指按照位为单位排序的
Set the bool array at the specified position, if it is exceeded, the data is discarded, the position refers to sorting in units of bits
|
void |
SetBool(boolean value,
int destIndex)
设置指定的位置bool值,如果超出,则丢弃数据,该位置是指按照位为单位排序的
Set the bool value at the specified position, if it is exceeded, the data is discarded, the position refers to sorting in units of bits
|
void |
SetBytes(byte[] data,
int destIndex)
设置指定的位置的数据块,如果超出,则丢弃数据
Set the data block at the specified position, if it is exceeded, the data is discarded
|
void |
SetBytes(byte[] data,
int destIndex,
int length)
设置指定的位置的数据块,如果超出,则丢弃数据
Set the data block at the specified position, if it is exceeded, the data is discarded
|
void |
SetBytes(byte[] data,
int sourceIndex,
int destIndex,
int length)
设置指定的位置的数据块,如果超出,则丢弃数据
Set the data block at the specified position, if it is exceeded, the data is discarded
|
void |
setByteTransform(IByteTransform byteTransform)
设置字节转换关系
|
<T extends IDataTransfer> |
SetCustomer(T data,
int index)
写入自定义类型的数据到缓存中去,需要规定生成字节的方法
Write custom type data to the cache, need to specify the method of generating bytes
|
void |
setIsBoolReverseByWord(boolean value)
设置当前的bool操作是否按照字节反转
|
void |
SetValue(byte value,
int index)
设置byte类型的数据到缓存区
Set byte type data to the cache area
|
void |
SetValue(double[] values,
int index)
设置double数组的数据到缓存区
Set double array data to the cache area
|
void |
SetValue(double value,
int index)
设置double类型的数据到缓存区
Set double type data to the cache area
|
void |
SetValue(float[] values,
int index)
设置float数组的数据到缓存区
Set float array data to the cache area
|
void |
SetValue(float value,
int index)
设置float类型的数据到缓存区
Set float type data to the cache area
|
void |
SetValue(int[] values,
int index)
设置int数组的数据到缓存区
Set int array data to the cache area
|
void |
SetValue(int value,
int index)
设置int类型的数据到缓存区
Set int type data to the cache area
|
void |
SetValue(long[] values,
int index)
设置long数组的数据到缓存区
Set long array data to the cache area
|
void |
SetValue(long value,
int index)
设置long类型的数据到缓存区
Set long type data to the cache area
|
void |
SetValue(short[] values,
int index)
设置short数组的数据到缓存区
Set short array data to the cache area
|
void |
SetValue(short value,
int index)
设置short类型的数据到缓存区
Set short type data to the cache area
|
String |
toString() |
public SoftBuffer()
public SoftBuffer(int capacity)
capacity - 初始化的容量public void SetBool(boolean value,
int destIndex)
value - 数据块信息destIndex - 目标存储的索引public void SetBool(boolean[] value,
int destIndex)
value - 数据块信息destIndex - 目标存储的索引public boolean GetBool(int destIndex)
throws IndexOutOfBoundsException
destIndex - 目标存储的索引IndexOutOfBoundsException - 索引超出异常public boolean[] GetBool(int destIndex,
int length)
destIndex - 目标存储的索引length - 读取的数组长度public void SetBytes(byte[] data,
int destIndex)
data - 数据块信息destIndex - 目标存储的索引public void SetBytes(byte[] data,
int destIndex,
int length)
data - 数据块信息destIndex - 目标存储的索引length - 准备拷贝的数据长度public void SetBytes(byte[] data,
int sourceIndex,
int destIndex,
int length)
data - 数据块信息sourceIndex - Data中的起始位置destIndex - 目标存储的索引length - 准备拷贝的数据长度public byte[] GetBytes(int index,
int length)
index - 起始位置length - 数组长度public byte[] GetBytes()
public void SetValue(byte value,
int index)
value - byte数值index - 索引位置public void SetValue(short[] values,
int index)
values - short数组index - 索引位置public void SetValue(short value,
int index)
value - short数值index - 索引位置public void SetValue(int[] values,
int index)
values - int数组index - 索引位置public void SetValue(int value,
int index)
value - int数值index - 索引位置public void SetValue(float[] values,
int index)
values - float数组index - 索引位置public void SetValue(float value,
int index)
value - float数值index - 索引位置public void SetValue(long[] values,
int index)
values - long数组index - 索引位置public void SetValue(long value,
int index)
value - long数值index - 索引位置public void SetValue(double[] values,
int index)
values - double数组index - 索引位置public void SetValue(double value,
int index)
value - double数值index - 索引位置public byte GetByte(int index)
index - 索引位置public short[] GetInt16(int index,
int length)
index - 索引位置length - 数组长度public short GetInt16(int index)
index - 索引位置public int[] GetInt32(int index,
int length)
index - 索引位置length - 数组长度public int GetInt32(int index)
index - 索引位置public float[] GetSingle(int index,
int length)
index - 索引位置length - 数组长度public float GetSingle(int index)
index - 索引位置public long[] GetInt64(int index,
int length)
index - 索引位置length - 数组长度public long GetInt64(int index)
index - 索引位置public double[] GetDouble(int index,
int length)
index - 索引位置length - 数组长度public double GetDouble(int index)
index - 索引位置public <T extends IDataTransfer> T GetCustomer(Class<T> type, int index) throws InstantiationException, IllegalAccessException
T - 类型对象type - 类型名称index - 起始索引InstantiationExceptionIllegalAccessExceptionpublic <T extends IDataTransfer> void SetCustomer(T data, int index)
T - 起始地址data - 自定义类型index - 实例对象public IByteTransform getByteTransform()
public void setByteTransform(IByteTransform byteTransform)
byteTransform - 字节转换关系public boolean getIsBoolReverseByWord()
public void setIsBoolReverseByWord(boolean value)
value - 设置值Copyright © 2022. All rights reserved.