ByteBuf

bytebuf文档点这里

基本信息:

ByteBuf类
java.lang.Object
io.netty.buffer.ByteBuf
所有已实现的接口:
ReferenceCounted,可比较< ByteBuf >
直接已知子类:
AbstractByteBuf,EmptyByteBuf,SwappedByteBuf

公共抽象类ByteBuf
扩展对象
实现ReferenceCounted,Comparable < ByteBuf >
零个或多个字节(八位字节)的随机且顺序可访问的序列。该接口提供了一个或多个原始字节数组(byte[])和NIO缓冲区的抽象视图。
顺序访问索引
ByteBuf提供两个指针变量以支持顺序的读和写操作-分别readerIndex用于读操作和writerIndex写操作。下图显示了如何通过两个指针将缓冲区划分为三个区域:
+ ------------------- + ------------------ + ---------- -------- +
| 可丢弃的字节| 可读字节| 可写字节|
| | (内容)| |
+ ------------------- + ------------------ + ---------- -------- +
| | | |
0 <= readerIndex <= writerIndex <=容量

readerIndex 和writerIndex 是两个索引,表示已读下标和未读下下标


文档:

abstract ByteBufAllocator alloc()
返回ByteBufAllocator创建此缓冲区的。
abstract byte[] array()
返回此缓冲区的后备字节数组。
abstract int arrayOffset()
返回此缓冲区的后备字节数组中第一个字节的偏移量。
abstract ByteBuf asReadOnly()
返回此缓冲区的只读版本。
abstract int bytesBefore(byte value)
value在此缓冲区中找到指定的第一个匹配项。
abstract int bytesBefore(int length, byte value)
value在此缓冲区中找到指定的第一个匹配项。
abstract int bytesBefore(int index, int length, byte value)
value在此缓冲区中找到指定的第一个匹配项。
abstract int capacity()
返回此缓冲区可以包含的字节数(八位字节)。
abstract ByteBuf capacity(int newCapacity)
调整此缓冲区的容量。
abstract ByteBuf clear()
将此缓冲区的readerIndex和设置writerIndex为 0。
abstract int compareTo(ByteBuf buffer)
将指定缓冲区的内容与此缓冲区的内容进行比较。
abstract ByteBuf copy()
返回此缓冲区的可读字节的副本。
abstract ByteBuf copy(int index, int length)
返回此缓冲区的子区域的副本。
abstract ByteBuf discardReadBytes()
丢弃第0个索引和之间的字节readerIndex。
abstract ByteBuf discardSomeReadBytes()
类似于discardReadBytes()此方法,不同之处在于,此方法可能会舍弃部分读取的字节,全部字节或不读取字节,具体取决于其内部实现,以减少总体内存带宽消耗为代价,但可能会增加潜在的内存消耗。
abstract ByteBuf duplicate()
返回一个共享该缓冲区整个区域的缓冲区。
abstract ByteBuf ensureWritable(int minWritableBytes)
扩展缓冲区capacity()以确保 可写字节数等于或大于指定值。
abstract int ensureWritable(int minWritableBytes, boolean force)
扩展缓冲区capacity()以确保 可写字节数等于或大于指定值。
abstract boolean equals(Object obj)
确定指定缓冲区的内容是否与此数组的内容相同。
abstract int forEachByte(ByteProcessor processor)
以指定processor的升序遍历此缓冲区的可读字节。
abstract int forEachByte(int index, int length, ByteProcessor processor)
以指定processor的升序遍历此缓冲区的指定区域。
abstract int forEachByteDesc(ByteProcessor processor)
以指定processor的降序遍历此缓冲区的可读字节。
abstract int forEachByteDesc(int index, int length, ByteProcessor processor)
processor以降序遍历此缓冲区的指定区域。
abstract boolean getBoolean(int index)
在此缓冲区中以指定的绝对值(@code index)获取一个布尔值。
abstract byte getByte(int index)
index在此缓冲区中以指定的绝对值获取一个字节。
abstract ByteBuf getBytes(int index, byte[] dst)
从指定的absolute处开始将此缓冲区的数据传输到指定的目标index。
abstract ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
从指定的absolute处开始将此缓冲区的数据传输到指定的目标index。
abstract ByteBuf getBytes(int index, ByteBuf dst)
从指定的绝对值开始将该缓冲区的数据传输到指定的目标,index直到目标变为不可写为止。
abstract ByteBuf getBytes(int index, ByteBuffer dst)
从指定的绝对值开始将此缓冲区的数据传输到指定的目标,index直到目标的位置达到其限制。
abstract ByteBuf getBytes(int index, ByteBuf dst, int length)
从指定的absolute处开始将此缓冲区的数据传输到指定的目标index。
abstract ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
从指定的absolute处开始将此缓冲区的数据传输到指定的目标index。
abstract int getBytes(int index, FileChannel out, long position, int length)
将从指定绝对值开始的此缓冲区的数据传输index 到从给定文件位置开始的指定通道。
abstract int getBytes(int index, GatheringByteChannel out, int length)
从指定的absolute处开始将此缓冲区的数据传输到指定的通道index。
abstract ByteBuf getBytes(int index, OutputStream out, int length)
从指定的absolute处开始将此缓冲区的数据传输到指定的流index。
abstract char getChar(int index)
index在此缓冲区中以指定的绝对值获取2字节的UTF-16字符 。
abstract CharSequence getCharSequence(int index, int length, Charset charset)
CharSequence在给定索引处获取具有给定长度的a 。
abstract double getDouble(int index)
获取index此缓冲区中指定绝对值的64位浮点数 。
double getDoubleLE(int index)
index以Little Endian Byte顺序获取此缓冲区中指定绝对值的64位浮点数 。
abstract float getFloat(int index)
index在此缓冲区中以指定的绝对值获取32位浮点数 。
float getFloatLE(int index)
index以Little Endian Byte顺序获取此缓冲区中指定绝对值的32位浮点数 。
abstract int getInt(int index)
index在此缓冲区中以指定的绝对值获取32位整数。
abstract int getIntLE(int index)
index以Little Endian Byte Order在此缓冲区中以指定的绝对值获取32位整数。
abstract long getLong(int index)
index在此缓冲区中以指定的绝对值获取64位长整数。
abstract long getLongLE(int index)
index以Little Endian Byte Order在此缓冲区中以指定的绝对值获取64位长整数。
abstract int getMedium(int index)
index在此缓冲区中以指定的绝对值获取24位中等整数。
abstract int getMediumLE(int index)
index以Little Endian Byte Order在此缓冲区中以指定的绝对值获取24位中等整数。
abstract short getShort(int index)
index在此缓冲区中以指定的绝对值获取16位短整数。
abstract short getShortLE(int index)
index以Little Endian Byte Order在此缓冲区中以指定的绝对值获取16位短整数。
abstract short getUnsignedByte(int index)
index在此缓冲区中以指定的绝对值获取一个无符号字节。
abstract long getUnsignedInt(int index)
index 在此缓冲区中以指定的绝对值获取一个无符号的32位整数。
abstract long getUnsignedIntLE(int index)
index 以Little Endian Byte顺序获取此缓冲区中指定绝对值的无符号32位整数。
abstract int getUnsignedMedium(int index)
index在此缓冲区中以指定的绝对值获取一个无符号的24位中等整数 。
abstract int getUnsignedMediumLE(int index)
index以Little Endian Byte顺序获取此缓冲区中指定绝对值的无符号24位中等整数 。
abstract int getUnsignedShort(int index)
index在此缓冲区中以指定的绝对值获取一个无符号的16位短整数 。
abstract int getUnsignedShortLE(int index)
index以Little Endian Byte Order在此缓冲区中的指定绝对值上获取一个无符号的16位短整数 。
abstract boolean hasArray()
true当且仅当此缓冲区具有后备字节数组时才返回。
abstract int hashCode()
返回根据该缓冲区的内容计算出的哈希码。
abstract boolean hasMemoryAddress()
true当且仅当此缓冲区具有指向底层数据的低级内存地址的引用时,才返回。
abstract int indexOf(int fromIndex, int toIndex, byte value)
value在此缓冲区中找到指定的第一个匹配项。
abstract ByteBuffer internalNioBuffer(int index, int length)
仅供内部使用:暴露内部NIO缓冲区。
boolean isContiguous()
true如果此ByteBuf实现由单个内存区域支持,则返回。
abstract boolean isDirect()
true当且仅当此缓冲区由NIO直接缓冲区支持时才返回。
abstract boolean isReadable()
true 当且仅当(this.writerIndex - this.readerIndex)大于时返回0。
abstract boolean isReadable(int size)
true当且仅当此缓冲区包含等于或大于指定数量的元素时,才返回。
abstract boolean isReadOnly()
返回true当且仅当此缓冲区是只读的。
abstract boolean isWritable()
true 当且仅当(this.capacity - this.writerIndex)大于时返回0。
abstract boolean isWritable(int size)
true当且仅当此缓冲区有足够的空间允许写入指定数量的元素时,才返回。
abstract ByteBuf markReaderIndex()
readerIndex在此缓冲区中标记当前。
abstract ByteBuf markWriterIndex()
writerIndex在此缓冲区中标记当前。
abstract int maxCapacity()
返回此缓冲区的最大允许容量。
int maxFastWritableBytes()
返回在不涉及内部重新分配或数据复制的情况下可以写入的最大字节数。
abstract int maxWritableBytes()
返回最大可写字节数,该值等于 (this.maxCapacity - this.writerIndex)。
abstract long memoryAddress()
返回指向该备份数据的第一个字节的低级存储器地址。
abstract ByteBuffer nioBuffer()
将此缓冲区的可读字节公开为NIO ByteBuffer。
abstract ByteBuffer nioBuffer(int index, int length)
将此缓冲区的子区域公开为NIO ByteBuffer。
abstract int nioBufferCount()
返回ByteBuffer组成此缓冲区的NIO的最大数量。
abstract ByteBuffer[] nioBuffers()
将此缓冲区的可读字节公开为NIO ByteBuffer。
abstract ByteBuffer[] nioBuffers(int index, int length)
ByteBuffer以指定索引和长度的NIO形式公开此缓冲区的字节。返回的缓冲区共享或包含此缓冲区的复制内容,而更改返回的NIO缓冲区的位置和限制不影响此缓冲区的索引和标记。
abstract ByteOrder order()
不推荐使用。
使用Little Endian访问器,例如getShortLE,getIntLE 而不是创建带有swapped的缓冲区endianness。
abstract ByteBuf order(ByteOrder endianness)
不推荐使用。
使用Little Endian访问器,例如getShortLE,getIntLE 而不是创建带有swapped的缓冲区endianness。
abstract int readableBytes()
返回等于的可读字节数 (this.writerIndex - this.readerIndex)。
abstract boolean readBoolean()
在当前缓冲区获取一个布尔值,readerIndex并在此缓冲区中增加readerIndexby 1。
abstract byte readByte()
在当前位置获取一个字节,readerIndex并在此缓冲区中增加readerIndexby 1。
abstract ByteBuf readBytes(byte[] dst)
从当前位置开始将该缓冲区的数据传输到指定的目标,readerIndex并readerIndex 通过传输的字节数(= dst.length)增加。
abstract ByteBuf readBytes(byte[] dst, int dstIndex, int length)
从当前位置开始将该缓冲区的数据传输到指定的目标,readerIndex并readerIndex 通过传输的字节数(= length)增加。
abstract ByteBuf readBytes(ByteBuf dst)
从当前开始将此缓冲区的数据传输到指定的目标,readerIndex直到该目标变为不可写为止,并readerIndex通过传输的字节数增加。
abstract ByteBuf readBytes(ByteBuffer dst)
从当前开始将此缓冲区的数据传输到指定的目标,readerIndex直到目标的位置达到其限制,并readerIndex通过传输的字节数增加。
abstract ByteBuf readBytes(ByteBuf dst, int length)
从当前位置开始将该缓冲区的数据传输到指定的目标,readerIndex并readerIndex 通过传输的字节数(= length)增加。
abstract ByteBuf readBytes(ByteBuf dst, int dstIndex, int length)
从当前位置开始将该缓冲区的数据传输到指定的目标,readerIndex并readerIndex 通过传输的字节数(= length)增加。
abstract int readBytes(FileChannel out, long position, int length)
从当前开始将此缓冲区的数据传输readerIndex 到从给定文件位置开始的指定通道。
abstract int readBytes(GatheringByteChannel out, int length)
从current开始,将此缓冲区的数据传输到指定的流readerIndex。
abstract ByteBuf readBytes(int length)
从当前开始将此缓冲区的数据传输到新创建的缓冲区,readerIndex并readerIndex 通过传输的字节数(= length)增加。
abstract ByteBuf readBytes(OutputStream out, int length)
从current开始,将此缓冲区的数据传输到指定的流readerIndex。
abstract char readChar()
当前获取2字节的UTF-16字符,readerIndex 并在此缓冲区中增加readerIndexby 2。
abstract CharSequence readCharSequence(int length, Charset charset)
CharSequence在当前获得具有给定长度的a ,readerIndex 并将其增加readerIndex给定长度。
abstract double readDouble()
在当前位置获取64位浮点数,readerIndex 并在此缓冲区中增加readerIndexby 8。
double readDoubleLE()
readerIndex 以Little Endian Byte顺序获取当前的64位浮点数,并在此缓冲区中增加readerIndex by 8。
abstract int readerIndex()
返回readerIndex此缓冲区的。
abstract ByteBuf readerIndex(int readerIndex)
设置readerIndex此缓冲区的。
abstract float readFloat()
在当前位置获取32位浮点数,readerIndex 并在此缓冲区中增加readerIndexby 4。
float readFloatLE()
readerIndex 以Little Endian Byte顺序获取当前的32位浮点数,并在此缓冲区中增加readerIndex by 4。
abstract int readInt()
在当前位置获取32位整数,readerIndex 并在此缓冲区中增加readerIndexby 4。
abstract int readIntLE()
readerIndex 以Little Endian Byte Order的当前值获取32位整数,并在此缓冲区中将readerIndex by增加4。
abstract long readLong()
在当前位置获取64位整数,readerIndex 并在此缓冲区中增加readerIndexby 8。
abstract long readLongLE()
readerIndex 以Little Endian字节顺序在当前位置获取64位整数,并在此缓冲区中增加readerIndex by 8。
abstract int readMedium()
在当前位置获取一个24位中等整数,readerIndex 并在此缓冲区中增加readerIndexby 3。
abstract int readMediumLE()
readerIndex 以Little Endian Byte Order的当前值获取24位中整数,并在此缓冲区中增加 readerIndexby 3。
abstract ByteBuf readRetainedSlice(int length)
从当前位置开始返回此缓冲区的子区域的新保留切片, readerIndex并将其增加readerIndex新切片(= length)的大小。
abstract short readShort()
在当前位置获取一个16位短整数,readerIndex 并在此缓冲区中增加readerIndexby 2。
abstract short readShortLE()
readerIndex 以Little Endian字节顺序在当前位置获取16位短整数,并在此缓冲区中增加readerIndex by 2。
abstract ByteBuf readSlice(int length)
从当前位置开始返回此缓冲区的子区域 的新片,并以新片(= )的大小readerIndex增加。readerIndexlength
abstract short readUnsignedByte()
在当前位置获取一个无符号字节,readerIndex并在此缓冲区中增加readerIndexby 1。
abstract long readUnsignedInt()
在当前位置获取一个无符号的32位整数,readerIndex 并在此缓冲区中增加readerIndexby 4。
abstract long readUnsignedIntLE()
readerIndex 以Little Endian Byte Order的当前值获取一个无符号的32位整数,并在此缓冲区中增加readerIndex by 4。
abstract int readUnsignedMedium()
在当前获取一个无符号的24位中等整数,readerIndex 并在此缓冲区中增加readerIndexby 3。
abstract int readUnsignedMediumLE()
readerIndex 以Little Endian Byte Order的当前值获取一个无符号的24位中等整数,并在此缓冲区中增加readerIndex by 3。
abstract int readUnsignedShort()
在当前获取一个无符号的16位短整数,readerIndex 并在此缓冲区中增加readerIndexby 2。
abstract int readUnsignedShortLE()
readerIndex 以Little Endian Byte Order的当前值获取一个无符号的16位短整数,并在此缓冲区中增加readerIndex by 2。
abstract ByteBuf resetReaderIndex()
将电流重新定位到此缓冲区中readerIndex标记的位置 readerIndex。
abstract ByteBuf resetWriterIndex()
将电流重新定位到此缓冲区中writerIndex标记的位置 writerIndex。
abstract ByteBuf retain()
将引用计数增加1。
abstract ByteBuf retain(int increment)
将引用计数增加指定的increment。
abstract ByteBuf retainedDuplicate()
返回共享该缓冲区整个区域的保留缓冲区。
abstract ByteBuf retainedSlice()
返回此缓冲区的可读字节的保留切片。
abstract ByteBuf retainedSlice(int index, int length)
返回此缓冲区的子区域的保留切片。
abstract ByteBuf setBoolean(int index, boolean value)
index在此缓冲区中将指定的布尔值设置为指定的绝对值。
abstract ByteBuf setByte(int index, int value)
将指定字节设置index为此缓冲区中的指定绝对值。
abstract ByteBuf setBytes(int index, byte[] src)
从指定的absolute开始,将指定的源数组的数据传输到此缓冲区index。
abstract ByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
从指定的absolute开始,将指定的源数组的数据传输到此缓冲区index。
abstract ByteBuf setBytes(int index, ByteBuf src)
从指定的绝对值开始,将指定的源缓冲区的数据传输到此缓冲区,index直到源缓冲区变得不可读为止。
abstract ByteBuf setBytes(int index, ByteBuffer src)
从指定的绝对值开始将指定的源缓冲区的数据传输到此缓冲区,index直到源缓冲区的位置达到其限制为止。
abstract ByteBuf setBytes(int index, ByteBuf src, int length)
从指定的absolute开始,将指定的源缓冲区的数据传输到此缓冲区index。
abstract ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)
从指定的absolute开始,将指定的源缓冲区的数据传输到此缓冲区index。
abstract int setBytes(int index, FileChannel in, long position, int length)
从给定文件位置开始将指定源通道的内容传输到此缓冲区,从指定absolute开始index。
abstract int setBytes(int index, InputStream in, int length)
从指定的absolute开始,将指定源流的内容传输到此缓冲区index。
abstract int setBytes(int index, ScatteringByteChannel in, int length)
从指定的absolute开始,将指定源通道的内容传输到此缓冲区index。
abstract ByteBuf setChar(int index, int value)
index在此缓冲区中以指定的绝对值设置指定的2字节UTF-16字符 。
abstract int setCharSequence(int index, CharSequence sequence, Charset charset)
将指定的值写入CharSequence当前位置,writerIndex然后writerIndex将写入的字节数增加。
abstract ByteBuf setDouble(int index, double value)
index在此缓冲区中以指定的绝对值设置指定的64位浮点数。
ByteBuf setDoubleLE(int index, double value)
index以Little Endian Byte Order在此缓冲区中的指定绝对值处设置指定的64位浮点数。
abstract ByteBuf setFloat(int index, float value)
index在此缓冲区中以指定的绝对值设置指定的32位浮点数。
ByteBuf setFloatLE(int index, float value)
index以Little Endian Byte Order在此缓冲区中的指定绝对值处设置指定的32位浮点数。
abstract ByteBuf setIndex(int readerIndex, int writerIndex)
一次设置此缓冲区的readerIndex和writerIndex。
abstract ByteBuf setInt(int index, int value)
index在此缓冲区中以指定的绝对值设置指定的32位整数 。
abstract ByteBuf setIntLE(int index, int value)
index以Little Endian字节顺序将此缓冲区中的指定32位整数设置为指定的绝对值 。
abstract ByteBuf setLong(int index, long value)
index在此缓冲区中以指定的绝对值设置指定的64位长整数 。
abstract ByteBuf setLongLE(int index, long value)
index以Little Endian Byte Order在此缓冲区中的指定绝对值处设置指定的64位长整数 。
abstract ByteBuf setMedium(int index, int value)
index在此缓冲区中将指定的24位中等整数设置为指定的绝对值 。
abstract ByteBuf setMediumLE(int index, int value)
index以Little Endian Byte Order在此缓冲区中的指定绝对值处设置指定的24位中等整数 。
abstract ByteBuf setShort(int index, int value)
index在此缓冲区中以指定的绝对值设置指定的16位短整数 。
abstract ByteBuf setShortLE(int index, int value)
index使用Little Endian Byte Order在此缓冲区中的指定绝对值处设置指定的16位短整数 。
abstract ByteBuf setZero(int index, int length)
从指定的absolute处开始,以NUL(0x00)填充此缓冲区index。
abstract ByteBuf skipBytes(int length)
将电流增加此缓冲区中readerIndex指定的值 length。
abstract ByteBuf slice()
返回此缓冲区的可读字节的一部分。
abstract ByteBuf slice(int index, int length)
返回此缓冲区的子区域的一部分。
abstract String toString()
返回此缓冲区的字符串表示形式。
abstract String toString(Charset charset)
将此缓冲区的可读字节解码为具有指定字符集名称的字符串。
abstract String toString(int index, int length, Charset charset)
将此缓冲区的子区域解码为具有指定字符集的字符串。
abstract ByteBuf touch()
记录此对象的当前访问位置以进行调试。
abstract ByteBuf touch(Object hint)
记录此对象的当前访问位置以及用于调试目的的其他任意信息。
abstract ByteBuf unwrap()
如果此缓冲区是另一个缓冲区的包装,则返回基础缓冲区实例。
abstract int writableBytes()
返回等于的可写字节数 (this.capacity - this.writerIndex)。
abstract ByteBuf writeBoolean(boolean value)
在当前位置设置指定的布尔值,writerIndex 并在此缓冲区中增加writerIndexby 1。
abstract ByteBuf writeByte(int value)
将指定的字节设置为当前字节,writerIndex 并在此缓冲区中增加writerIndexby 1。
abstract ByteBuf writeBytes(byte[] src)
从当前开始将指定的源数组的数据传输到此缓冲区,writerIndex并writerIndex 通过传输的字节数(= src.length)增加。
abstract ByteBuf writeBytes(byte[] src, int srcIndex, int length)
从当前开始将指定的源数组的数据传输到此缓冲区,writerIndex并writerIndex 通过传输的字节数(= length)增加。
abstract ByteBuf writeBytes(ByteBuf src)
从当前开始,将指定的源缓冲区的数据传输到此缓冲区,writerIndex直到源缓冲区变得不可读为止,并writerIndex通过传输的字节数增加。
abstract ByteBuf writeBytes(ByteBuffer src)
从当前开始,将指定的源缓冲区的数据传输到此缓冲区,writerIndex直到源缓冲区的位置达到其限制,然后writerIndex将传输的字节数增加。
abstract ByteBuf writeBytes(ByteBuf src, int length)
从当前开始将指定的源缓冲区的数据传输到此缓冲区,writerIndex并writerIndex 通过传输的字节数(= length)增加。
abstract ByteBuf writeBytes(ByteBuf src, int srcIndex, int length)
从当前开始将指定的源缓冲区的数据传输到此缓冲区,writerIndex并writerIndex 通过传输的字节数(= length)增加。
abstract int writeBytes(FileChannel in, long position, int length)
从给定文件位置开始将指定通道的内容传输到当前位置开始的此缓冲区,writerIndex并writerIndex通过传输的字节数增加 。
abstract int writeBytes(InputStream in, int length)
从当前开始,将指定流的内容传输到此缓冲区,writerIndex并writerIndex通过传输的字节数增加 。
abstract int writeBytes(ScatteringByteChannel in, int length)
从当前开始,将指定通道的内容传输到此缓冲区,writerIndex并writerIndex通过传输的字节数增加 。
abstract ByteBuf writeChar(int value)
在当前位置设置指定的2字节UTF-16字符, writerIndex并 在此缓冲区中增加writerIndexby 2。
abstract int writeCharSequence(CharSequence sequence, Charset charset)
将指定的值写入CharSequence当前位置,writerIndex然后writerIndex将写入的字节数增加。
abstract ByteBuf writeDouble(double value)
在当前位置设置指定的64位浮点数, writerIndex并 在此缓冲区中增加writerIndexby 8。
ByteBuf writeDoubleLE(double value)
writerIndex以Little Endian Byte Order的当前顺序设置指定的64位浮点数, 并在此缓冲区中增加writerIndexby 8。
abstract ByteBuf writeFloat(float value)
在当前位置设置指定的32位浮点数, writerIndex并 在此缓冲区中增加writerIndexby 4。
ByteBuf writeFloatLE(float value)
writerIndex以Little Endian Byte Order的当前顺序设置指定的32位浮点数, 并在此缓冲区中增加writerIndexby 4。
abstract ByteBuf writeInt(int value)
在当前位置设置指定的32位整数,writerIndex 并在此缓冲区中增加writerIndexby 4。
abstract ByteBuf writeIntLE(int value)
writerIndex 以Little Endian Byte Order当前的方式设置指定的32位整数,并在此缓冲区中增加writerIndex by 4。
abstract ByteBuf writeLong(long value)
在当前位置设置指定的64位长整数, writerIndex并 在此缓冲区中增加writerIndexby 8。
abstract ByteBuf writeLongLE(long value)
writerIndex以Little Endian Byte Order的当前顺序设置指定的64位长整数, 并 在此缓冲区中增加writerIndexby 8。
abstract ByteBuf writeMedium(int value)
在当前位置设置指定的24位中等整数, writerIndex并 在此缓冲区中增加writerIndexby 3。
abstract ByteBuf writeMediumLE(int value)
writerIndex以Little Endian Byte Order的当前值设置指定的24位中等整数, 并在此缓冲区中增加writerIndexby 3。
abstract int writerIndex()
返回writerIndex此缓冲区的。
abstract ByteBuf writerIndex(int writerIndex)
设置writerIndex此缓冲区的。
abstract ByteBuf writeShort(int value)
在当前位置设置指定的16位短整数, writerIndex并 在此缓冲区中增加writerIndexby 2。
abstract ByteBuf writeShortLE(int value)
以当前Little Endian字节顺序设置指定的16位短整数,writerIndex并在此缓冲区中增加 writerIndexby 2。
abstract ByteBuf writeZero(int length)
从当前位置开始, 以NUL(0x00)填充此缓冲区,writerIndex并writerIndex以指定的递增length。


Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐