Class UnsafeByteBufUtil

java.lang.Object
io.netty.buffer.UnsafeByteBufUtil

final class UnsafeByteBufUtil extends Object
All operations get and set as ByteOrder.BIG_ENDIAN.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
    private static final boolean
     
    private static final byte
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    batchSetZero(byte[] data, int index, int length)
     
    private static void
    batchSetZero(long addr, int length)
     
    (package private) static ByteBuf
    copy(AbstractByteBuf buf, long addr, int index, int length)
     
    (package private) static byte
    getByte(byte[] array, int index)
     
    (package private) static byte
    getByte(long address)
     
    private static void
    getBytes(long inAddr, byte[] in, int inOffset, int inLen, OutputStream out, int outLen)
     
    (package private) static void
    getBytes(AbstractByteBuf buf, long addr, int index, byte[] dst, int dstIndex, int length)
     
    (package private) static void
    getBytes(AbstractByteBuf buf, long addr, int index, ByteBuf dst, int dstIndex, int length)
     
    (package private) static void
    getBytes(AbstractByteBuf buf, long addr, int index, OutputStream out, int length)
     
    (package private) static void
    getBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer dst)
     
    (package private) static int
    getInt(byte[] array, int index)
     
    (package private) static int
    getInt(long address)
     
    (package private) static int
    getIntLE(byte[] array, int index)
     
    (package private) static int
    getIntLE(long address)
     
    (package private) static long
    getLong(byte[] array, int index)
     
    (package private) static long
    getLong(long address)
     
    (package private) static long
    getLongLE(byte[] array, int index)
     
    (package private) static long
    getLongLE(long address)
     
    (package private) static short
    getShort(byte[] array, int index)
     
    (package private) static short
    getShort(long address)
     
    (package private) static short
    getShortLE(byte[] array, int index)
     
    (package private) static short
    getShortLE(long address)
     
    (package private) static int
    getUnsignedMedium(byte[] array, int index)
     
    (package private) static int
    getUnsignedMedium(long address)
     
    (package private) static int
    getUnsignedMediumLE(byte[] array, int index)
     
    (package private) static int
    getUnsignedMediumLE(long address)
     
    (package private) static UnpooledUnsafeDirectByteBuf
    newUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)
     
    (package private) static void
    setByte(byte[] array, int index, int value)
     
    (package private) static void
    setByte(long address, int value)
     
    (package private) static void
    setBytes(AbstractByteBuf buf, long addr, int index, byte[] src, int srcIndex, int length)
     
    (package private) static void
    setBytes(AbstractByteBuf buf, long addr, int index, ByteBuf src, int srcIndex, int length)
     
    (package private) static int
    setBytes(AbstractByteBuf buf, long addr, int index, InputStream in, int length)
     
    (package private) static void
    setBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer src)
     
    (package private) static void
    setInt(byte[] array, int index, int value)
     
    (package private) static void
    setInt(long address, int value)
     
    (package private) static void
    setIntLE(byte[] array, int index, int value)
     
    (package private) static void
    setIntLE(long address, int value)
     
    (package private) static void
    setLong(byte[] array, int index, long value)
     
    (package private) static void
    setLong(long address, long value)
     
    (package private) static void
    setLongLE(byte[] array, int index, long value)
     
    (package private) static void
    setLongLE(long address, long value)
     
    (package private) static void
    setMedium(byte[] array, int index, int value)
     
    (package private) static void
    setMedium(long address, int value)
     
    (package private) static void
    setMediumLE(byte[] array, int index, int value)
     
    (package private) static void
    setMediumLE(long address, int value)
     
    (package private) static void
    setShort(byte[] array, int index, int value)
     
    (package private) static void
    setShort(long address, int value)
     
    (package private) static void
    setShortLE(byte[] array, int index, int value)
     
    (package private) static void
    setShortLE(long address, int value)
     
    private static void
    setSingleBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer src, int length)
     
    (package private) static void
    setZero(byte[] array, int index, int length)
     
    (package private) static void
    setZero(long addr, int length)
     
    private static int
    zeroTillAligned(long addr, int length)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNALIGNED

      private static final boolean UNALIGNED
    • ZERO

      private static final byte ZERO
      See Also:
    • MAX_HAND_ROLLED_SET_ZERO_BYTES

      private static final int MAX_HAND_ROLLED_SET_ZERO_BYTES
      See Also:
  • Constructor Details

    • UnsafeByteBufUtil

      private UnsafeByteBufUtil()
  • Method Details

    • getByte

      static byte getByte(long address)
    • getShort

      static short getShort(long address)
    • getShortLE

      static short getShortLE(long address)
    • getUnsignedMedium

      static int getUnsignedMedium(long address)
    • getUnsignedMediumLE

      static int getUnsignedMediumLE(long address)
    • getInt

      static int getInt(long address)
    • getIntLE

      static int getIntLE(long address)
    • getLong

      static long getLong(long address)
    • getLongLE

      static long getLongLE(long address)
    • setByte

      static void setByte(long address, int value)
    • setShort

      static void setShort(long address, int value)
    • setShortLE

      static void setShortLE(long address, int value)
    • setMedium

      static void setMedium(long address, int value)
    • setMediumLE

      static void setMediumLE(long address, int value)
    • setInt

      static void setInt(long address, int value)
    • setIntLE

      static void setIntLE(long address, int value)
    • setLong

      static void setLong(long address, long value)
    • setLongLE

      static void setLongLE(long address, long value)
    • getByte

      static byte getByte(byte[] array, int index)
    • getShort

      static short getShort(byte[] array, int index)
    • getShortLE

      static short getShortLE(byte[] array, int index)
    • getUnsignedMedium

      static int getUnsignedMedium(byte[] array, int index)
    • getUnsignedMediumLE

      static int getUnsignedMediumLE(byte[] array, int index)
    • getInt

      static int getInt(byte[] array, int index)
    • getIntLE

      static int getIntLE(byte[] array, int index)
    • getLong

      static long getLong(byte[] array, int index)
    • getLongLE

      static long getLongLE(byte[] array, int index)
    • setByte

      static void setByte(byte[] array, int index, int value)
    • setShort

      static void setShort(byte[] array, int index, int value)
    • setShortLE

      static void setShortLE(byte[] array, int index, int value)
    • setMedium

      static void setMedium(byte[] array, int index, int value)
    • setMediumLE

      static void setMediumLE(byte[] array, int index, int value)
    • setInt

      static void setInt(byte[] array, int index, int value)
    • setIntLE

      static void setIntLE(byte[] array, int index, int value)
    • setLong

      static void setLong(byte[] array, int index, long value)
    • setLongLE

      static void setLongLE(byte[] array, int index, long value)
    • batchSetZero

      private static void batchSetZero(byte[] data, int index, int length)
    • setZero

      static void setZero(byte[] array, int index, int length)
    • copy

      static ByteBuf copy(AbstractByteBuf buf, long addr, int index, int length)
    • setBytes

      static int setBytes(AbstractByteBuf buf, long addr, int index, InputStream in, int length) throws IOException
      Throws:
      IOException
    • getBytes

      static void getBytes(AbstractByteBuf buf, long addr, int index, ByteBuf dst, int dstIndex, int length)
    • getBytes

      static void getBytes(AbstractByteBuf buf, long addr, int index, byte[] dst, int dstIndex, int length)
    • getBytes

      static void getBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer dst)
    • setBytes

      static void setBytes(AbstractByteBuf buf, long addr, int index, ByteBuf src, int srcIndex, int length)
    • setBytes

      static void setBytes(AbstractByteBuf buf, long addr, int index, byte[] src, int srcIndex, int length)
    • setBytes

      static void setBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer src)
    • setSingleBytes

      private static void setSingleBytes(AbstractByteBuf buf, long addr, int index, ByteBuffer src, int length)
    • getBytes

      static void getBytes(AbstractByteBuf buf, long addr, int index, OutputStream out, int length) throws IOException
      Throws:
      IOException
    • getBytes

      private static void getBytes(long inAddr, byte[] in, int inOffset, int inLen, OutputStream out, int outLen) throws IOException
      Throws:
      IOException
    • batchSetZero

      private static void batchSetZero(long addr, int length)
    • setZero

      static void setZero(long addr, int length)
    • zeroTillAligned

      private static int zeroTillAligned(long addr, int length)
    • newUnsafeDirectByteBuf

      static UnpooledUnsafeDirectByteBuf newUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)