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
SpecialSwappedByteBufforByteBufs that is using unsafe.
-
-
Field Summary
Fields Modifier and Type Field Description private booleannativeByteOrderprivate AbstractByteBufwrapped
-
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)chargetChar(int index)Gets a 2-byte UTF-16 character at the specified absoluteindexin this buffer.doublegetDouble(int index)Gets a 64-bit floating point number at the specified absoluteindexin this buffer.floatgetFloat(int index)Gets a 32-bit floating point number at the specified absoluteindexin this buffer.intgetInt(int index)Gets a 32-bit integer at the specified absoluteindexin this buffer.longgetLong(int index)Gets a 64-bit long integer at the specified absoluteindexin this buffer.shortgetShort(int index)Gets a 16-bit short integer at the specified absoluteindexin this buffer.longgetUnsignedInt(int index)Gets an unsigned 32-bit integer at the specified absoluteindexin this buffer.intgetUnsignedShort(int index)Gets an unsigned 16-bit short integer at the specified absoluteindexin this buffer.ByteBufsetChar(int index, int value)Sets the specified 2-byte UTF-16 character at the specified absoluteindexin this buffer.ByteBufsetDouble(int index, double value)Sets the specified 64-bit floating-point number at the specified absoluteindexin this buffer.ByteBufsetFloat(int index, float value)Sets the specified 32-bit floating-point number at the specified absoluteindexin this buffer.ByteBufsetInt(int index, int value)Sets the specified 32-bit integer at the specified absoluteindexin this buffer.ByteBufsetLong(int index, long value)Sets the specified 64-bit long integer at the specified absoluteindexin this buffer.ByteBufsetShort(int index, int value)Sets the specified 16-bit short integer at the specified absoluteindexin this buffer.ByteBufwriteChar(int value)Sets the specified 2-byte UTF-16 character at the currentwriterIndexand increases thewriterIndexby2in this buffer.ByteBufwriteDouble(double value)Sets the specified 64-bit floating point number at the currentwriterIndexand increases thewriterIndexby8in this buffer.ByteBufwriteFloat(float value)Sets the specified 32-bit floating point number at the currentwriterIndexand increases thewriterIndexby4in this buffer.ByteBufwriteInt(int value)Sets the specified 32-bit integer at the currentwriterIndexand increases thewriterIndexby4in this buffer.ByteBufwriteLong(long value)Sets the specified 64-bit long integer at the currentwriterIndexand increases thewriterIndexby8in this buffer.ByteBufwriteShort(int value)Sets the specified 16-bit short integer at the currentwriterIndexand increases thewriterIndexby2in 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:ByteBufGets a 64-bit long integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getLongin classSwappedByteBuf
-
getFloat
public final float getFloat(int index)
Description copied from class:ByteBufGets a 32-bit floating point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getFloatin classSwappedByteBuf
-
getDouble
public final double getDouble(int index)
Description copied from class:ByteBufGets a 64-bit floating point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getDoublein classSwappedByteBuf
-
getChar
public final char getChar(int index)
Description copied from class:ByteBufGets a 2-byte UTF-16 character at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getCharin classSwappedByteBuf
-
getUnsignedInt
public final long getUnsignedInt(int index)
Description copied from class:ByteBufGets an unsigned 32-bit integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getUnsignedIntin classSwappedByteBuf
-
getInt
public final int getInt(int index)
Description copied from class:ByteBufGets a 32-bit integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getIntin classSwappedByteBuf
-
getUnsignedShort
public final int getUnsignedShort(int index)
Description copied from class:ByteBufGets an unsigned 16-bit short integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getUnsignedShortin classSwappedByteBuf
-
getShort
public final short getShort(int index)
Description copied from class:ByteBufGets a 16-bit short integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
getShortin classSwappedByteBuf
-
setShort
public final ByteBuf setShort(int index, int value)
Description copied from class:ByteBufSets the specified 16-bit short integer at the specified absoluteindexin this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setShortin classSwappedByteBuf
-
setInt
public final ByteBuf setInt(int index, int value)
Description copied from class:ByteBufSets the specified 32-bit integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setIntin classSwappedByteBuf
-
setLong
public final ByteBuf setLong(int index, long value)
Description copied from class:ByteBufSets the specified 64-bit long integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setLongin classSwappedByteBuf
-
setChar
public final ByteBuf setChar(int index, int value)
Description copied from class:ByteBufSets the specified 2-byte UTF-16 character at the specified absoluteindexin this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setCharin classSwappedByteBuf
-
setFloat
public final ByteBuf setFloat(int index, float value)
Description copied from class:ByteBufSets the specified 32-bit floating-point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setFloatin classSwappedByteBuf
-
setDouble
public final ByteBuf setDouble(int index, double value)
Description copied from class:ByteBufSets the specified 64-bit floating-point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Overrides:
setDoublein classSwappedByteBuf
-
writeShort
public final ByteBuf writeShort(int value)
Description copied from class:ByteBufSets the specified 16-bit short integer at the currentwriterIndexand increases thewriterIndexby2in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytesis less than2,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeShortin classSwappedByteBuf
-
writeInt
public final ByteBuf writeInt(int value)
Description copied from class:ByteBufSets the specified 32-bit integer at the currentwriterIndexand increases thewriterIndexby4in this buffer. Ifthis.writableBytesis less than4,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeIntin classSwappedByteBuf
-
writeLong
public final ByteBuf writeLong(long value)
Description copied from class:ByteBufSets the specified 64-bit long integer at the currentwriterIndexand increases thewriterIndexby8in this buffer. Ifthis.writableBytesis less than8,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeLongin classSwappedByteBuf
-
writeChar
public final ByteBuf writeChar(int value)
Description copied from class:ByteBufSets the specified 2-byte UTF-16 character at the currentwriterIndexand increases thewriterIndexby2in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytesis less than2,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeCharin classSwappedByteBuf
-
writeFloat
public final ByteBuf writeFloat(float value)
Description copied from class:ByteBufSets the specified 32-bit floating point number at the currentwriterIndexand increases thewriterIndexby4in this buffer. Ifthis.writableBytesis less than4,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeFloatin classSwappedByteBuf
-
writeDouble
public final ByteBuf writeDouble(double value)
Description copied from class:ByteBufSets the specified 64-bit floating point number at the currentwriterIndexand increases thewriterIndexby8in this buffer. Ifthis.writableBytesis less than8,ByteBuf.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Overrides:
writeDoublein 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)
-
-