@Deprecated public class DuplicatedByteBuf extends AbstractDerivedByteBuf
ByteBuf.duplicate() instead
of calling the constructor explicitly.| Constructor and Description |
|---|
DuplicatedByteBuf(ByteBuf buffer)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected byte |
_getByte(int index)
Deprecated.
|
protected int |
_getInt(int index)
Deprecated.
|
protected long |
_getLong(int index)
Deprecated.
|
protected short |
_getShort(int index)
Deprecated.
|
protected int |
_getUnsignedMedium(int index)
Deprecated.
|
protected void |
_setByte(int index,
int value)
Deprecated.
|
protected void |
_setInt(int index,
int value)
Deprecated.
|
protected void |
_setLong(int index,
long value)
Deprecated.
|
protected void |
_setMedium(int index,
int value)
Deprecated.
|
protected void |
_setShort(int index,
int value)
Deprecated.
|
ByteBufAllocator |
alloc()
Deprecated.
Returns the
ByteBufAllocator which created this buffer. |
byte[] |
array()
Deprecated.
Returns the backing byte array of this buffer.
|
int |
arrayOffset()
Deprecated.
Returns the offset of the first byte within the backing byte array of
this buffer.
|
int |
capacity()
Deprecated.
Returns the number of bytes (octets) this buffer can contain.
|
ByteBuf |
capacity(int newCapacity)
Deprecated.
Adjusts the capacity of this buffer.
|
ByteBuf |
copy(int index,
int length)
Deprecated.
Returns a copy of this buffer's sub-region.
|
int |
forEachByte(int index,
int length,
ByteBufProcessor processor)
Deprecated.
Iterates over the specified area of this buffer with the specified
processor in ascending order. |
int |
forEachByteDesc(int index,
int length,
ByteBufProcessor processor)
Deprecated.
Iterates over the specified area of this buffer with the specified
processor in descending order. |
byte |
getByte(int index)
Deprecated.
Gets a byte at the specified absolute
index in this buffer. |
ByteBuf |
getBytes(int index,
byte[] dst,
int dstIndex,
int length)
Deprecated.
Transfers this buffer's data to the specified destination starting at
the specified absolute
index. |
ByteBuf |
getBytes(int index,
java.nio.ByteBuffer dst)
Deprecated.
Transfers this buffer's data to the specified destination starting at
the specified absolute
index until the destination's position
reaches its limit. |
ByteBuf |
getBytes(int index,
ByteBuf dst,
int dstIndex,
int length)
Deprecated.
Transfers this buffer's data to the specified destination starting at
the specified absolute
index. |
int |
getBytes(int index,
java.nio.channels.GatheringByteChannel out,
int length)
Deprecated.
Transfers this buffer's data to the specified channel starting at the
specified absolute
index. |
ByteBuf |
getBytes(int index,
java.io.OutputStream out,
int length)
Deprecated.
Transfers this buffer's data to the specified stream starting at the
specified absolute
index. |
int |
getInt(int index)
Deprecated.
Gets a 32-bit integer at the specified absolute
index in
this buffer. |
long |
getLong(int index)
Deprecated.
Gets a 64-bit long integer at the specified absolute
index in
this buffer. |
short |
getShort(int index)
Deprecated.
Gets a 16-bit short integer at the specified absolute
index in
this buffer. |
int |
getUnsignedMedium(int index)
Deprecated.
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
boolean |
hasArray()
Deprecated.
Returns
true if and only if this buffer has a backing byte array. |
boolean |
hasMemoryAddress()
Deprecated.
Returns
true if and only if this buffer has a reference to the low-level memory address that points
to the backing data. |
boolean |
isDirect()
Deprecated.
Returns
true if and only if this buffer is backed by an
NIO direct buffer. |
long |
memoryAddress()
Deprecated.
Returns the low-level memory address that point to the first byte of ths backing data.
|
int |
nioBufferCount()
Deprecated.
Returns the maximum number of NIO
ByteBuffers that consist this buffer. |
java.nio.ByteBuffer[] |
nioBuffers(int index,
int length)
Deprecated.
Exposes this buffer's bytes as an NIO
ByteBuffer's for the specified index and length
The returned buffer either share or contains the copied content of this buffer, while changing
the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer. |
java.nio.ByteOrder |
order()
Deprecated.
|
ByteBuf |
setByte(int index,
int value)
Deprecated.
Sets the specified byte at the specified absolute
index in this
buffer. |
ByteBuf |
setBytes(int index,
byte[] src,
int srcIndex,
int length)
Deprecated.
Transfers the specified source array's data to this buffer starting at
the specified absolute
index. |
ByteBuf |
setBytes(int index,
java.nio.ByteBuffer src)
Deprecated.
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index until the source buffer's position
reaches its limit. |
ByteBuf |
setBytes(int index,
ByteBuf src,
int srcIndex,
int length)
Deprecated.
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index. |
int |
setBytes(int index,
java.io.InputStream in,
int length)
Deprecated.
Transfers the content of the specified source stream to this buffer
starting at the specified absolute
index. |
int |
setBytes(int index,
java.nio.channels.ScatteringByteChannel in,
int length)
Deprecated.
Transfers the content of the specified source channel to this buffer
starting at the specified absolute
index. |
ByteBuf |
setInt(int index,
int value)
Deprecated.
Sets the specified 32-bit integer at the specified absolute
index in this buffer. |
ByteBuf |
setLong(int index,
long value)
Deprecated.
Sets the specified 64-bit long integer at the specified absolute
index in this buffer. |
ByteBuf |
setMedium(int index,
int value)
Deprecated.
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer. |
ByteBuf |
setShort(int index,
int value)
Deprecated.
Sets the specified 16-bit short integer at the specified absolute
index in this buffer. |
ByteBuf |
slice(int index,
int length)
Deprecated.
Returns a slice of this buffer's sub-region.
|
ByteBuf |
unwrap()
Deprecated.
Return the underlying buffer instance if this buffer is a wrapper of another buffer.
|
internalNioBuffer, nioBuffer, refCnt, release, release, retain, retainadjustMarkers, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getMedium, getUnsignedByte, getUnsignedInt, getUnsignedShort, hashCode, indexOf, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, resetReaderIndex, resetWriterIndex, setBoolean, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setZero, skipBytes, slice, toString, toString, toString, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZeropublic DuplicatedByteBuf(ByteBuf buffer)
public ByteBuf unwrap()
ByteBufpublic ByteBufAllocator alloc()
ByteBufByteBufAllocator which created this buffer.@Deprecated public java.nio.ByteOrder order()
ByteBufpublic boolean isDirect()
ByteBuftrue if and only if this buffer is backed by an
NIO direct buffer.public int capacity()
ByteBufpublic ByteBuf capacity(int newCapacity)
ByteBufnewCapacity is less than the current
capacity, the content of this buffer is truncated. If the newCapacity is greater
than the current capacity, the buffer is appended with unspecified data whose length is
(newCapacity - currentCapacity).public boolean hasArray()
ByteBuftrue if and only if this buffer has a backing byte array.
If this method returns true, you can safely call ByteBuf.array() and
ByteBuf.arrayOffset().public byte[] array()
ByteBufpublic int arrayOffset()
ByteBufarrayOffset in class ByteBufpublic boolean hasMemoryAddress()
ByteBuftrue if and only if this buffer has a reference to the low-level memory address that points
to the backing data.hasMemoryAddress in class ByteBufpublic long memoryAddress()
ByteBufmemoryAddress in class ByteBufpublic byte getByte(int index)
ByteBufindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.getByte in class AbstractByteBufprotected byte _getByte(int index)
_getByte in class AbstractByteBufpublic short getShort(int index)
ByteBufindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.getShort in class AbstractByteBufprotected short _getShort(int index)
_getShort in class AbstractByteBufpublic int getUnsignedMedium(int index)
ByteBufindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.getUnsignedMedium in class AbstractByteBufprotected int _getUnsignedMedium(int index)
_getUnsignedMedium in class AbstractByteBufpublic int getInt(int index)
ByteBufindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.getInt in class AbstractByteBufprotected int _getInt(int index)
_getInt in class AbstractByteBufpublic long getLong(int index)
ByteBufindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.getLong in class AbstractByteBufprotected long _getLong(int index)
_getLong in class AbstractByteBufpublic ByteBuf copy(int index, int length)
ByteBufreaderIndex or writerIndex of
this buffer.public ByteBuf slice(int index, int length)
ByteBufreaderIndex or writerIndex of
this buffer.
Also be aware that this method will NOT call ByteBuf.retain() and so the
reference count will NOT be increased.
slice in class AbstractByteBufpublic ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
ByteBufindex.
This method does not modify readerIndex or writerIndex
of both the source (i.e. this) and the destination.public ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
ByteBufindex.
This method does not modify readerIndex or writerIndex
of this buffer.public ByteBuf getBytes(int index, java.nio.ByteBuffer dst)
ByteBufindex until the destination's position
reaches its limit.
This method does not modify readerIndex or writerIndex of
this buffer while the destination's position will be increased.public ByteBuf setByte(int index, int value)
ByteBufindex in this
buffer. The 24 high-order bits of the specified value are ignored.
This method does not modify readerIndex or writerIndex of
this buffer.setByte in class AbstractByteBufprotected void _setByte(int index,
int value)
_setByte in class AbstractByteBufpublic ByteBuf setShort(int index, int value)
ByteBufindex in this buffer. The 16 high-order bits of the specified
value are ignored.
This method does not modify readerIndex or writerIndex of
this buffer.setShort in class AbstractByteBufprotected void _setShort(int index,
int value)
_setShort in class AbstractByteBufpublic ByteBuf setMedium(int index, int value)
ByteBufindex in this buffer. Please note that the most significant
byte is ignored in the specified value.
This method does not modify readerIndex or writerIndex of
this buffer.setMedium in class AbstractByteBufprotected void _setMedium(int index,
int value)
_setMedium in class AbstractByteBufpublic ByteBuf setInt(int index, int value)
ByteBufindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setInt in class AbstractByteBufprotected void _setInt(int index,
int value)
_setInt in class AbstractByteBufpublic ByteBuf setLong(int index, long value)
ByteBufindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setLong in class AbstractByteBufprotected void _setLong(int index,
long value)
_setLong in class AbstractByteBufpublic ByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
ByteBufindex.
This method does not modify readerIndex or writerIndex of
this buffer.public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)
ByteBufindex.
This method does not modify readerIndex or writerIndex
of both the source (i.e. this) and the destination.public ByteBuf setBytes(int index, java.nio.ByteBuffer src)
ByteBufindex until the source buffer's position
reaches its limit.
This method does not modify readerIndex or writerIndex of
this buffer.public ByteBuf getBytes(int index, java.io.OutputStream out, int length) throws java.io.IOException
ByteBufindex.
This method does not modify readerIndex or writerIndex of
this buffer.public int getBytes(int index,
java.nio.channels.GatheringByteChannel out,
int length)
throws java.io.IOException
ByteBufindex.
This method does not modify readerIndex or writerIndex of
this buffer.public int setBytes(int index,
java.io.InputStream in,
int length)
throws java.io.IOException
ByteBufindex.
This method does not modify readerIndex or writerIndex of
this buffer.public int setBytes(int index,
java.nio.channels.ScatteringByteChannel in,
int length)
throws java.io.IOException
ByteBufindex.
This method does not modify readerIndex or writerIndex of
this buffer.public int nioBufferCount()
ByteBufByteBuffers that consist this buffer. Note that ByteBuf.nioBuffers()
or ByteBuf.nioBuffers(int, int) might return a less number of ByteBuffers.nioBufferCount in class ByteBuf-1 if this buffer has no underlying ByteBuffer.
the number of the underlying ByteBuffers if this buffer has at least one underlying
ByteBuffer. Note that this method does not return 0 to avoid confusion.ByteBuf.nioBuffer(),
ByteBuf.nioBuffer(int, int),
ByteBuf.nioBuffers(),
ByteBuf.nioBuffers(int, int)public java.nio.ByteBuffer[] nioBuffers(int index,
int length)
ByteBufByteBuffer's for the specified index and length
The returned buffer either share or contains the copied content of this buffer, while changing
the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer.
This method does not modify readerIndex or writerIndex of this buffer. Please note that the
returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic
buffer and it adjusted its capacity.nioBuffers in class ByteBufByteBuf.nioBufferCount(),
ByteBuf.nioBuffer(),
ByteBuf.nioBuffer(int, int)public int forEachByte(int index,
int length,
ByteBufProcessor processor)
ByteBufprocessor in ascending order.
(i.e. index, (index + 1), .. (index + length - 1))forEachByte in class AbstractByteBuf-1 if the processor iterated to or beyond the end of the specified area.
The last-visited index If the ByteBufProcessor.process(byte) returned false.public int forEachByteDesc(int index,
int length,
ByteBufProcessor processor)
ByteBufprocessor in descending order.
(i.e. (index + length - 1), (index + length - 2), ... index)forEachByteDesc in class AbstractByteBuf-1 if the processor iterated to or beyond the beginning of the specified area.
The last-visited index If the ByteBufProcessor.process(byte) returned false.Copyright © 2008–2018 The Netty Project. All rights reserved.