io.netty.buffer

## Class UnpooledUnsafeDirectByteBufWrapper

- java.lang.Object
- - io.netty.buffer.ByteBuf
  - - io.netty.buffer.AbstractByteBuf
    - - io.netty.buffer.AbstractReferenceCountedByteBuf
      - - io.netty.buffer.UnpooledUnsafeDirectByteBufWrapper

- All Implemented Interfaces:
    io.netty.util.ReferenceCounted, Comparable<ByteBuf>

      public final class UnpooledUnsafeDirectByteBufWrapper
      extends AbstractReferenceCountedByteBuf

  A NIO `ByteBuffer`, byte[] and address direct access wrapper. Only content manipulation operations are supported. Is best suited only for encoding/decoding purposes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnpooledUnsafeDirectByteBufWrapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected byte` | `_getByte(int index)`
    `protected int` | `_getInt(int index)`
    `protected int` | `_getIntLE(int index)`
    `protected long` | `_getLong(int index)`
    `protected long` | `_getLongLE(int index)`
    `protected short` | `_getShort(int index)`
    `protected short` | `_getShortLE(int index)`
    `protected int` | `_getUnsignedMedium(int index)`
    `protected int` | `_getUnsignedMediumLE(int index)`
    `protected void` | `_setByte(int index, int value)`
    `protected void` | `_setInt(int index, int value)`
    `protected void` | `_setIntLE(int index, int value)`
    `protected void` | `_setLong(int index, long value)`
    `protected void` | `_setLongLE(int index, long value)`
    `protected void` | `_setMedium(int index, int value)`
    `protected void` | `_setMediumLE(int index, int value)`
    `protected void` | `_setShort(int index, int value)`
    `protected void` | `_setShortLE(int index, int value)`
    `ByteBufAllocator` | `alloc()`
    `byte[]` | `array()`
    `int` | `arrayOffset()`
    `int` | `capacity()`
    `ByteBuf` | `capacity(int newCapacity)`
    `ByteBuf` | `copy(int index, int length)` Deprecated.
    `protected void` | `deallocate()` Deprecated.
    `ByteBuf` | `getBytes(int index, byte[] dst, int dstIndex, int length)`
    `ByteBuf` | `getBytes(int index, ByteBuffer dst)`
    `ByteBuf` | `getBytes(int index, ByteBuf dst, int dstIndex, int length)`
    `int` | `getBytes(int index, FileChannel out, long position, int length)` Deprecated.
    `int` | `getBytes(int index, GatheringByteChannel out, int length)` Deprecated.
    `ByteBuf` | `getBytes(int index, OutputStream out, int length)` Deprecated.
    `boolean` | `hasArray()`
    `boolean` | `hasMemoryAddress()`
    `ByteBuffer` | `internalNioBuffer(int index, int length)` Deprecated.
    `boolean` | `isDirect()`
    `long` | `memoryAddress()`
    `protected SwappedByteBuf` | `newSwappedByteBuf()` Deprecated.
    `ByteBuffer` | `nioBuffer(int index, int length)` Deprecated.
    `int` | `nioBufferCount()`
    `ByteBuffer[]` | `nioBuffers(int index, int length)` Deprecated.
    `ByteOrder` | `order()`
    `ByteBuf` | `readBytes(ByteBuffer dst)`
    `int` | `readBytes(FileChannel out, long position, int length)` Deprecated.
    `int` | `readBytes(GatheringByteChannel out, int length)` Deprecated.
    `void` | `reset()`
    `ByteBuf` | `setBytes(int index, byte[] src, int srcIndex, int length)`
    `ByteBuf` | `setBytes(int index, ByteBuffer src)`
    `ByteBuf` | `setBytes(int index, ByteBuf src, int srcIndex, int length)`
    `int` | `setBytes(int index, FileChannel in, long position, int length)` Deprecated.
    `int` | `setBytes(int index, InputStream in, int length)` Deprecated.
    `int` | `setBytes(int index, ScatteringByteChannel in, int length)` Deprecated.
    `ByteBuf` | `setZero(int index, int length)`
    `ByteBuf` | `unwrap()`
    `void` | `wrap(byte[] array, int srcIndex, int length)`
    `void` | `wrap(ByteBuffer buffer, int srcIndex, int length)`
    `void` | `wrap(long address, int length)`
    `ByteBuf` | `writeZero(int length)`

    - ### Methods inherited from class io.netty.buffer.AbstractReferenceCountedByteBuf

      `refCnt, release, release, retain, retain, setRefCnt, touch, touch`

    - ### Methods inherited from class io.netty.buffer.AbstractByteBuf

      `adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, 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, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, skipBytes, slice, slice, toString, toString, toString, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UnpooledUnsafeDirectByteBufWrapper

          public UnpooledUnsafeDirectByteBufWrapper()

  - ### Method Detail

    - #### wrap

          public void wrap(long address,
                           int length)

    - #### wrap

          public void wrap(byte[] array,
                           int srcIndex,
                           int length)

    - #### wrap

          public void wrap(ByteBuffer buffer,
                           int srcIndex,
                           int length)

    - #### reset

          public void reset()

    - #### isDirect

          public boolean isDirect()

      Specified by:
        `isDirect` in class `ByteBuf`

    - #### capacity

          public int capacity()

      Specified by:
        `capacity` in class `ByteBuf`

    - #### capacity

          public ByteBuf capacity(int newCapacity)

      Specified by:
        `capacity` in class `ByteBuf`

    - #### alloc

          public ByteBufAllocator alloc()

      Specified by:
        `alloc` in class `ByteBuf`

    - #### order

          public ByteOrder order()

      Specified by:
        `order` in class `ByteBuf`

    - #### hasArray

          public boolean hasArray()

      Specified by:
        `hasArray` in class `ByteBuf`

    - #### array

          public byte[] array()

      Specified by:
        `array` in class `ByteBuf`

    - #### arrayOffset

          public int arrayOffset()

      Specified by:
        `arrayOffset` in class `ByteBuf`

    - #### hasMemoryAddress

          public boolean hasMemoryAddress()

      Specified by:
        `hasMemoryAddress` in class `ByteBuf`

    - #### memoryAddress

          public long memoryAddress()

      Specified by:
        `memoryAddress` in class `ByteBuf`

    - #### _getByte

          protected byte _getByte(int index)

      Specified by:
        `_getByte` in class `AbstractByteBuf`

    - #### _getShort

          protected short _getShort(int index)

      Specified by:
        `_getShort` in class `AbstractByteBuf`

    - #### _getShortLE

          protected short _getShortLE(int index)

      Specified by:
        `_getShortLE` in class `AbstractByteBuf`

    - #### _getUnsignedMedium

          protected int _getUnsignedMedium(int index)

      Specified by:
        `_getUnsignedMedium` in class `AbstractByteBuf`

    - #### _getUnsignedMediumLE

          protected int _getUnsignedMediumLE(int index)

      Specified by:
        `_getUnsignedMediumLE` in class `AbstractByteBuf`

    - #### _getInt

          protected int _getInt(int index)

      Specified by:
        `_getInt` in class `AbstractByteBuf`

    - #### _getIntLE

          protected int _getIntLE(int index)

      Specified by:
        `_getIntLE` in class `AbstractByteBuf`

    - #### _getLong

          protected long _getLong(int index)

      Specified by:
        `_getLong` in class `AbstractByteBuf`

    - #### _getLongLE

          protected long _getLongLE(int index)

      Specified by:
        `_getLongLE` in class `AbstractByteBuf`

    - #### getBytes

          public ByteBuf getBytes(int index,
                                  ByteBuf dst,
                                  int dstIndex,
                                  int length)

      Specified by:
        `getBytes` in class `ByteBuf`

    - #### getBytes

          public ByteBuf getBytes(int index,
                                  byte[] dst,
                                  int dstIndex,
                                  int length)

      Specified by:
        `getBytes` in class `ByteBuf`

    - #### getBytes

          public ByteBuf getBytes(int index,
                                  ByteBuffer dst)

      Specified by:
        `getBytes` in class `ByteBuf`

    - #### readBytes

          public ByteBuf readBytes(ByteBuffer dst)

      Overrides:
        `readBytes` in class `AbstractByteBuf`

    - #### _setByte

          protected void _setByte(int index,
                                  int value)

      Specified by:
        `_setByte` in class `AbstractByteBuf`

    - #### _setShort

          protected void _setShort(int index,
                                   int value)

      Specified by:
        `_setShort` in class `AbstractByteBuf`

    - #### _setShortLE

          protected void _setShortLE(int index,
                                     int value)

      Specified by:
        `_setShortLE` in class `AbstractByteBuf`

    - #### _setMedium

          protected void _setMedium(int index,
                                    int value)

      Specified by:
        `_setMedium` in class `AbstractByteBuf`

    - #### _setMediumLE

          protected void _setMediumLE(int index,
                                      int value)

      Specified by:
        `_setMediumLE` in class `AbstractByteBuf`

    - #### _setInt

          protected void _setInt(int index,
                                 int value)

      Specified by:
        `_setInt` in class `AbstractByteBuf`

    - #### _setIntLE

          protected void _setIntLE(int index,
                                   int value)

      Specified by:
        `_setIntLE` in class `AbstractByteBuf`

    - #### _setLong

          protected void _setLong(int index,
                                  long value)

      Specified by:
        `_setLong` in class `AbstractByteBuf`

    - #### _setLongLE

          protected void _setLongLE(int index,
                                    long value)

      Specified by:
        `_setLongLE` in class `AbstractByteBuf`

    - #### setBytes

          public ByteBuf setBytes(int index,
                                  ByteBuf src,
                                  int srcIndex,
                                  int length)

      Specified by:
        `setBytes` in class `ByteBuf`

    - #### setBytes

          public ByteBuf setBytes(int index,
                                  byte[] src,
                                  int srcIndex,
                                  int length)

      Specified by:
        `setBytes` in class `ByteBuf`

    - #### setBytes

          public ByteBuf setBytes(int index,
                                  ByteBuffer src)

      Specified by:
        `setBytes` in class `ByteBuf`

    - #### getBytes

          @Deprecated
          public ByteBuf getBytes(int index,
                                              OutputStream out,
                                              int length)
                                       throws IOException

      Deprecated.
      Specified by:
        `getBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### getBytes

          @Deprecated
          public int getBytes(int index,
                                          GatheringByteChannel out,
                                          int length)
                                   throws IOException

      Deprecated.
      Specified by:
        `getBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### getBytes

          @Deprecated
          public int getBytes(int index,
                                          FileChannel out,
                                          long position,
                                          int length)
                                   throws IOException

      Deprecated.
      Specified by:
        `getBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### readBytes

          @Deprecated
          public int readBytes(GatheringByteChannel out,
                                           int length)
                                    throws IOException

      Deprecated.
      Overrides:
        `readBytes` in class `AbstractByteBuf`
      Throws:
        `IOException`

    - #### readBytes

          @Deprecated
          public int readBytes(FileChannel out,
                                           long position,
                                           int length)
                                    throws IOException

      Deprecated.
      Overrides:
        `readBytes` in class `AbstractByteBuf`
      Throws:
        `IOException`

    - #### setBytes

          @Deprecated
          public int setBytes(int index,
                                          InputStream in,
                                          int length)
                                   throws IOException

      Deprecated.
      Specified by:
        `setBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### setBytes

          @Deprecated
          public int setBytes(int index,
                                          ScatteringByteChannel in,
                                          int length)
                                   throws IOException

      Deprecated.
      Specified by:
        `setBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### setBytes

          @Deprecated
          public int setBytes(int index,
                                          FileChannel in,
                                          long position,
                                          int length)
                                   throws IOException

      Deprecated.
      Specified by:
        `setBytes` in class `ByteBuf`
      Throws:
        `IOException`

    - #### nioBufferCount

          public int nioBufferCount()

      Specified by:
        `nioBufferCount` in class `ByteBuf`

    - #### nioBuffers

          @Deprecated
          public ByteBuffer[] nioBuffers(int index,
                                                     int length)

      Deprecated.
      Specified by:
        `nioBuffers` in class `ByteBuf`

    - #### copy

          @Deprecated
          public ByteBuf copy(int index,
                                          int length)

      Deprecated.
      Specified by:
        `copy` in class `ByteBuf`

    - #### internalNioBuffer

          @Deprecated
          public ByteBuffer internalNioBuffer(int index,
                                                          int length)

      Deprecated.
      Specified by:
        `internalNioBuffer` in class `ByteBuf`

    - #### nioBuffer

          @Deprecated
          public ByteBuffer nioBuffer(int index,
                                                  int length)

      Deprecated.
      Specified by:
        `nioBuffer` in class `ByteBuf`

    - #### deallocate

          @Deprecated
          protected void deallocate()

      Deprecated.
      Specified by:
        `deallocate` in class `AbstractReferenceCountedByteBuf`

    - #### unwrap

          public ByteBuf unwrap()

      Specified by:
        `unwrap` in class `ByteBuf`

    - #### newSwappedByteBuf

          @Deprecated
          protected SwappedByteBuf newSwappedByteBuf()

      Deprecated.
      Overrides:
        `newSwappedByteBuf` in class `AbstractByteBuf`

    - #### setZero

          public ByteBuf setZero(int index,
                                 int length)

      Overrides:
        `setZero` in class `AbstractByteBuf`

    - #### writeZero

          public ByteBuf writeZero(int length)

      Overrides:
        `writeZero` in class `AbstractByteBuf`

Copyright © 2017 The Apache Software Foundation. All rights reserved.