Package io.netty.buffer
Class AbstractUnsafeSwappedByteBuf
- java.lang.Object
-
- io.netty.buffer.ByteBuf
-
- io.netty.buffer.SwappedByteBuf
-
- io.netty.buffer.AbstractUnsafeSwappedByteBuf
-
- All Implemented Interfaces:
ReferenceCounted
,java.lang.Comparable<ByteBuf>
- Direct Known Subclasses:
UnsafeDirectSwappedByteBuf
,UnsafeHeapSwappedByteBuf
abstract class AbstractUnsafeSwappedByteBuf extends SwappedByteBuf
SpecialSwappedByteBuf
forByteBuf
s that is using unsafe.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
nativeByteOrder
private AbstractByteBuf
wrapped
-
Constructor Summary
Constructors Constructor Description AbstractUnsafeSwappedByteBuf(AbstractByteBuf buf)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
_getInt(AbstractByteBuf wrapped, int index)
protected abstract long
_getLong(AbstractByteBuf wrapped, int index)
protected abstract short
_getShort(AbstractByteBuf wrapped, int index)
protected abstract void
_setInt(AbstractByteBuf wrapped, int index, int value)
protected abstract void
_setLong(AbstractByteBuf wrapped, int index, long value)
protected abstract void
_setShort(AbstractByteBuf wrapped, int index, short value)
char
getChar(int index)
Gets a 2-byte UTF-16 character at the specified absoluteindex
in this buffer.double
getDouble(int index)
Gets a 64-bit floating point number at the specified absoluteindex
in this buffer.float
getFloat(int index)
Gets a 32-bit floating point number at the specified absoluteindex
in this buffer.int
getInt(int index)
Gets a 32-bit integer at the specified absoluteindex
in this buffer.long
getLong(int index)
Gets a 64-bit long integer at the specified absoluteindex
in this buffer.short
getShort(int index)
Gets a 16-bit short integer at the specified absoluteindex
in this buffer.long
getUnsignedInt(int index)
Gets an unsigned 32-bit integer at the specified absoluteindex
in this buffer.int
getUnsignedShort(int index)
Gets an unsigned 16-bit short integer at the specified absoluteindex
in this buffer.ByteBuf
setChar(int index, int value)
Sets the specified 2-byte UTF-16 character at the specified absoluteindex
in this buffer.ByteBuf
setDouble(int index, double value)
Sets the specified 64-bit floating-point number at the specified absoluteindex
in this buffer.ByteBuf
setFloat(int index, float value)
Sets the specified 32-bit floating-point number at the specified absoluteindex
in this buffer.ByteBuf
setInt(int index, int value)
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer.ByteBuf
setLong(int index, long value)
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer.ByteBuf
setShort(int index, int value)
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer.ByteBuf
writeChar(int value)
Sets the specified 2-byte UTF-16 character at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer.ByteBuf
writeDouble(double value)
Sets the specified 64-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer.ByteBuf
writeFloat(float value)
Sets the specified 32-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer.ByteBuf
writeInt(int value)
Sets the specified 32-bit integer at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer.ByteBuf
writeLong(long value)
Sets the specified 64-bit long integer at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer.ByteBuf
writeShort(int value)
Sets the specified 16-bit short integer at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer.-
Methods inherited from class io.netty.buffer.SwappedByteBuf
alloc, array, arrayOffset, asReadOnly, bytesBefore, bytesBefore, bytesBefore, capacity, capacity, clear, compareTo, copy, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getCharSequence, getIntLE, getLongLE, getMedium, getMediumLE, getShortLE, getUnsignedByte, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShortLE, hasArray, hashCode, hasMemoryAddress, indexOf, internalNioBuffer, isAccessible, isContiguous, isDirect, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxFastWritableBytes, maxWritableBytes, memoryAddress, nioBuffer, nioBuffer, nioBufferCount, nioBuffers, nioBuffers, order, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, refCnt, release, release, resetReaderIndex, resetWriterIndex, retain, retain, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setCharSequence, setIndex, setIntLE, setLongLE, setMedium, setMediumLE, setShortLE, setZero, skipBytes, slice, slice, toString, toString, toString, touch, touch, unwrap, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeCharSequence, writeIntLE, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShortLE, writeZero
-
Methods inherited from class io.netty.buffer.ByteBuf
getDoubleLE, getFloatLE, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
-
-
-
-
Field Detail
-
nativeByteOrder
private final boolean nativeByteOrder
-
wrapped
private final AbstractByteBuf wrapped
-
-
Constructor Detail
-
AbstractUnsafeSwappedByteBuf
AbstractUnsafeSwappedByteBuf(AbstractByteBuf buf)
-
-
Method Detail
-
getLong
public final long getLong(int index)
Description copied from class:ByteBuf
Gets a 64-bit long integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getLong
in classSwappedByteBuf
-
getFloat
public final float getFloat(int index)
Description copied from class:ByteBuf
Gets a 32-bit floating point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getFloat
in classSwappedByteBuf
-
getDouble
public final double getDouble(int index)
Description copied from class:ByteBuf
Gets a 64-bit floating point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getDouble
in classSwappedByteBuf
-
getChar
public final char getChar(int index)
Description copied from class:ByteBuf
Gets a 2-byte UTF-16 character at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getChar
in classSwappedByteBuf
-
getUnsignedInt
public final long getUnsignedInt(int index)
Description copied from class:ByteBuf
Gets an unsigned 32-bit integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getUnsignedInt
in classSwappedByteBuf
-
getInt
public final int getInt(int index)
Description copied from class:ByteBuf
Gets a 32-bit integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getInt
in classSwappedByteBuf
-
getUnsignedShort
public final int getUnsignedShort(int index)
Description copied from class:ByteBuf
Gets an unsigned 16-bit short integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getUnsignedShort
in classSwappedByteBuf
-
getShort
public final short getShort(int index)
Description copied from class:ByteBuf
Gets a 16-bit short integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
getShort
in classSwappedByteBuf
-
setShort
public final ByteBuf setShort(int index, int value)
Description copied from class:ByteBuf
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setShort
in classSwappedByteBuf
-
setInt
public final ByteBuf setInt(int index, int value)
Description copied from class:ByteBuf
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setInt
in classSwappedByteBuf
-
setLong
public final ByteBuf setLong(int index, long value)
Description copied from class:ByteBuf
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setLong
in classSwappedByteBuf
-
setChar
public final ByteBuf setChar(int index, int value)
Description copied from class:ByteBuf
Sets the specified 2-byte UTF-16 character at the specified absoluteindex
in this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setChar
in classSwappedByteBuf
-
setFloat
public final ByteBuf setFloat(int index, float value)
Description copied from class:ByteBuf
Sets the specified 32-bit floating-point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setFloat
in classSwappedByteBuf
-
setDouble
public final ByteBuf setDouble(int index, double value)
Description copied from class:ByteBuf
Sets the specified 64-bit floating-point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Overrides:
setDouble
in classSwappedByteBuf
-
writeShort
public final ByteBuf writeShort(int value)
Description copied from class:ByteBuf
Sets the specified 16-bit short integer at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than2
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeShort
in classSwappedByteBuf
-
writeInt
public final ByteBuf writeInt(int value)
Description copied from class:ByteBuf
Sets the specified 32-bit integer at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer. Ifthis.writableBytes
is less than4
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeInt
in classSwappedByteBuf
-
writeLong
public final ByteBuf writeLong(long value)
Description copied from class:ByteBuf
Sets the specified 64-bit long integer at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer. Ifthis.writableBytes
is less than8
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeLong
in classSwappedByteBuf
-
writeChar
public final ByteBuf writeChar(int value)
Description copied from class:ByteBuf
Sets the specified 2-byte UTF-16 character at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than2
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeChar
in classSwappedByteBuf
-
writeFloat
public final ByteBuf writeFloat(float value)
Description copied from class:ByteBuf
Sets the specified 32-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer. Ifthis.writableBytes
is less than4
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeFloat
in classSwappedByteBuf
-
writeDouble
public final ByteBuf writeDouble(double value)
Description copied from class:ByteBuf
Sets the specified 64-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer. Ifthis.writableBytes
is less than8
,ByteBuf.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Overrides:
writeDouble
in classSwappedByteBuf
-
_getShort
protected abstract short _getShort(AbstractByteBuf wrapped, int index)
-
_getInt
protected abstract int _getInt(AbstractByteBuf wrapped, int index)
-
_getLong
protected abstract long _getLong(AbstractByteBuf wrapped, int index)
-
_setShort
protected abstract void _setShort(AbstractByteBuf wrapped, int index, short value)
-
_setInt
protected abstract void _setInt(AbstractByteBuf wrapped, int index, int value)
-
_setLong
protected abstract void _setLong(AbstractByteBuf wrapped, int index, long value)
-
-