GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.buffer
  • UnpooledUnsafeDirectByteBuf

This view

  • Original page
  • New address

GeezerVison is showing netty.io — UnpooledUnsafeDirectByteBuf (Netty API Reference (4.1.141.Final))

Class UnpooledUnsafeDirectByteBuf

java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
io.netty.buffer.AbstractReferenceCountedByteBuf
io.netty.buffer.UnpooledDirectByteBuf
io.netty.buffer.UnpooledUnsafeDirectByteBuf
All Implemented Interfaces:
ByteBufConvertible, ReferenceCounted, Comparable<ByteBuf>

public class UnpooledUnsafeDirectByteBuf extends UnpooledDirectByteBuf
A NIO ByteBuffer based buffer. It is recommended to use AbstractByteBufAllocator.directBuffer(int, int), Unpooled.directBuffer(int) and Unpooled.wrappedBuffer(ByteBuffer) instead of calling the constructor explicitly.}
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)
    Creates a new direct buffer.
    protected
    UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity)
    Creates a new direct buffer by wrapping the specified initial buffer.
  • Method Summary

    Modifier and Type
    Method
    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)
     
    ByteBuf
    copy(int index, int length)
    Returns a copy of this buffer's sub-region.
    byte
    getByte(int index)
    Gets a byte at the specified absolute index in this buffer.
    ByteBuf
    getBytes(int index, ByteBuf dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    int
    getInt(int index)
    Gets a 32-bit integer at the specified absolute index in this buffer.
    long
    getLong(int index)
    Gets a 64-bit long integer at the specified absolute index in this buffer.
    short
    getShort(int index)
    Gets a 16-bit short integer at the specified absolute index in this buffer.
    int
    getUnsignedMedium(int index)
    Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer.
    boolean
    hasMemoryAddress()
    Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
    long
    memoryAddress()
    Returns the low-level memory address that point to the first byte of ths backing data.
    protected SwappedByteBuf
    newSwappedByteBuf()
    Creates a new SwappedByteBuf for this ByteBuf instance.
    ByteBuf
    setByte(int index, int value)
    Sets the specified byte at the specified absolute index in this buffer.
    ByteBuf
    setBytes(int index, byte[] src, int srcIndex, int length)
    Transfers the specified source array's data to this buffer starting at the specified absolute index.
    ByteBuf
    setBytes(int index, ByteBuf src, int srcIndex, int length)
    Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
    int
    setBytes(int index, InputStream in, int length)
    Transfers the content of the specified source stream to this buffer starting at the specified absolute index.
    ByteBuf
    setBytes(int index, ByteBuffer src)
    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
    setInt(int index, int value)
    Sets the specified 32-bit integer at the specified absolute index in this buffer.
    ByteBuf
    setLong(int index, long value)
    Sets the specified 64-bit long integer at the specified absolute index in this buffer.
    ByteBuf
    setMedium(int index, int value)
    Sets the specified 24-bit medium integer at the specified absolute index in this buffer.
    ByteBuf
    setShort(int index, int value)
    Sets the specified 16-bit short integer at the specified absolute index in this buffer.
    ByteBuf
    setZero(int index, int length)
    Fills this buffer with NUL (0x00) starting at the specified absolute index.
    ByteBuf
    writeZero(int length)
    Fills this buffer with NUL (0x00) starting at the current writerIndex and increases the writerIndex by the specified length.

    Methods inherited from class UnpooledDirectByteBuf

    alloc, allocateDirect, array, arrayOffset, capacity, capacity, deallocate, freeDirect, getBytes, getBytes, getBytes, getBytes, getBytes, hasArray, internalNioBuffer, isContiguous, isDirect, nioBuffer, nioBufferCount, nioBuffers, order, readBytes, readBytes, readBytes, readBytes, readBytes, setBytes, setBytes, unwrap
    Modifier and Type
    Method
    Description
    ByteBufAllocator
    alloc()
    Returns the ByteBufAllocator which created this buffer.
    protected ByteBuffer
    allocateDirect(int initialCapacity)
    Allocate a new direct ByteBuffer with the given initialCapacity.
    byte[]
    array()
    Returns the backing byte array of this buffer.
    int
    arrayOffset()
    Returns the offset of the first byte within the backing byte array of this buffer.
    int
    capacity()
    Returns the number of bytes (octets) this buffer can contain.
    ByteBuf
    capacity(int newCapacity)
    Adjusts the capacity of this buffer.
    protected void
    deallocate()
    Called once AbstractReferenceCountedByteBuf.refCnt() is equals 0.
    protected void
    freeDirect(ByteBuffer buffer)
    Free a direct ByteBuffer
    ByteBuf
    getBytes(int index, byte[] dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    ByteBuf
    getBytes(int index, OutputStream out, int length)
    Transfers this buffer's data to the specified stream starting at the specified absolute index.
    ByteBuf
    getBytes(int index, ByteBuffer dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit.
    int
    getBytes(int index, FileChannel out, long position, int length)
    Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position.
    int
    getBytes(int index, GatheringByteChannel out, int length)
    Transfers this buffer's data to the specified channel starting at the specified absolute index.
    boolean
    hasArray()
    Returns true if and only if this buffer has a backing byte array.
    ByteBuffer
    internalNioBuffer(int index, int length)
    Internal use only: Exposes the internal NIO buffer.
    final boolean
    isContiguous()
    Returns true if this ByteBuf implementation is backed by a single memory region.
    boolean
    isDirect()
    Returns true if and only if this buffer is backed by an NIO direct buffer.
    ByteBuffer
    nioBuffer(int index, int length)
    Exposes this buffer's sub-region as an NIO ByteBuffer.
    int
    nioBufferCount()
    Returns the maximum number of NIO ByteBuffers that consist this buffer.
    ByteBuffer[]
    nioBuffers(int index, int length)
    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.
    ByteOrder
    order()
    Returns the endianness of this buffer.
    ByteBuf
    readBytes(byte[] dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    ByteBuf
    readBytes(OutputStream out, int length)
    Transfers this buffer's data to the specified stream starting at the current readerIndex.
    ByteBuf
    readBytes(ByteBuffer dst)
    Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.
    int
    readBytes(FileChannel out, long position, int length)
    Transfers this buffer's data starting at the current readerIndex to the specified channel starting at the given file position.
    int
    readBytes(GatheringByteChannel out, int length)
    Transfers this buffer's data to the specified stream starting at the current readerIndex.
    int
    setBytes(int index, FileChannel in, long position, int length)
    Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index.
    int
    setBytes(int index, ScatteringByteChannel in, int length)
    Transfers the content of the specified source channel to this buffer starting at the specified absolute index.
    ByteBuf
    unwrap()
    Return the underlying buffer instance if this buffer is a wrapper of another buffer.

    Methods inherited from class AbstractReferenceCountedByteBuf

    refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touch
    Modifier and Type
    Method
    Description
    int
    refCnt()
    Returns the reference count of this object.
    boolean
    release()
    Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
    boolean
    release(int decrement)
    Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
    protected final void
    resetRefCnt()
    An unsafe operation intended for use by a subclass that resets the reference count of the buffer to 1
    ByteBuf
    retain()
    Increases the reference count by 1.
    ByteBuf
    retain(int increment)
    Increases the reference count by the specified increment.
    protected final void
    setRefCnt(int refCnt)
    An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
    ByteBuf
    touch()
    Records the current access location of this object for debugging purposes.
    ByteBuf
    touch(Object hint)
    Records the current access location of this object with an additional arbitrary information for debugging purposes.

    Methods inherited from class AbstractByteBuf

    adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getIntLE, getLongLE, getMedium, getMediumLE, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, 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, 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, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setIntLE, setLongLE, setMediumLE, setShortLE, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, 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
    Modifier and Type
    Method
    Description
    protected final void
    adjustMarkers(int decrement)
     
    ByteBuf
    asReadOnly()
    Returns a read-only version of this buffer.
    int
    bytesBefore(byte value)
    Locates the first occurrence of the specified value in this buffer.
    int
    bytesBefore(int length, byte value)
    Locates the first occurrence of the specified value in this buffer.
    int
    bytesBefore(int index, int length, byte value)
    Locates the first occurrence of the specified value in this buffer.
    protected final void
    checkDstIndex(int length, int dstIndex, int dstCapacity)
     
    protected final void
    checkDstIndex(int index, int length, int dstIndex, int dstCapacity)
     
    protected final void
    checkIndex(int index)
     
    protected final void
    checkIndex(int index, int fieldLength)
     
    protected final void
    checkNewCapacity(int newCapacity)
     
    protected final void
    checkReadableBytes(int minimumReadableBytes)
    Throws an IndexOutOfBoundsException if the current readable bytes of this buffer is less than the specified value.
    protected final void
    checkSrcIndex(int index, int length, int srcIndex, int srcCapacity)
     
    ByteBuf
    clear()
    Sets the readerIndex and writerIndex of this buffer to 0.
    int
    compareTo(ByteBuf that)
    Compares the content of the specified buffer to the content of this buffer.
    ByteBuf
    copy()
    Returns a copy of this buffer's readable bytes.
    ByteBuf
    discardReadBytes()
    Discards the bytes between the 0th index and readerIndex.
    ByteBuf
    discardSomeReadBytes()
    Similar to ByteBuf.discardReadBytes() except that this method might discard some, all, or none of read bytes depending on its internal implementation to reduce overall memory bandwidth consumption at the cost of potentially additional memory consumption.
    ByteBuf
    duplicate()
    Returns a buffer which shares the whole region of this buffer.
    protected final void
    ensureAccessible()
    Should be called by every method that tries to access the buffers content to check if the buffer was released before.
    ByteBuf
    ensureWritable(int minWritableBytes)
    Expands the buffer ByteBuf.capacity() to make sure the number of writable bytes is equal to or greater than the specified value.
    int
    ensureWritable(int minWritableBytes, boolean force)
    Expands the buffer ByteBuf.capacity() to make sure the number of writable bytes is equal to or greater than the specified value.
    boolean
    equals(Object o)
    Determines if the content of the specified buffer is identical to the content of this array.
    int
    forEachByte(int index, int length, ByteProcessor processor)
    Iterates over the specified area of this buffer with the specified processor in ascending order.
    int
    forEachByte(ByteProcessor processor)
    Iterates over the readable bytes of this buffer with the specified processor in ascending order.
    int
    forEachByteDesc(int index, int length, ByteProcessor processor)
    Iterates over the specified area of this buffer with the specified processor in descending order.
    int
    forEachByteDesc(ByteProcessor processor)
    Iterates over the readable bytes of this buffer with the specified processor in descending order.
    boolean
    getBoolean(int index)
    Gets a boolean at the specified absolute (@code index) in this buffer.
    ByteBuf
    getBytes(int index, byte[] dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    ByteBuf
    getBytes(int index, ByteBuf dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination becomes non-writable.
    ByteBuf
    getBytes(int index, ByteBuf dst, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    char
    getChar(int index)
    Gets a 2-byte UTF-16 character at the specified absolute index in this buffer.
    CharSequence
    getCharSequence(int index, int length, Charset charset)
    Gets a CharSequence with the given length at the given index.
    double
    getDouble(int index)
    Gets a 64-bit floating point number at the specified absolute index in this buffer.
    float
    getFloat(int index)
    Gets a 32-bit floating point number at the specified absolute index in this buffer.
    int
    getIntLE(int index)
    Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order.
    long
    getLongLE(int index)
    Gets a 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order.
    int
    getMedium(int index)
    Gets a 24-bit medium integer at the specified absolute index in this buffer.
    int
    getMediumLE(int index)
    Gets a 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order.
    short
    getShortLE(int index)
    Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
    short
    getUnsignedByte(int index)
    Gets an unsigned byte at the specified absolute index in this buffer.
    long
    getUnsignedInt(int index)
    Gets an unsigned 32-bit integer at the specified absolute index in this buffer.
    long
    getUnsignedIntLE(int index)
    Gets an unsigned 32-bit integer at the specified absolute index in this buffer in Little Endian Byte Order.
    int
    getUnsignedMediumLE(int index)
    Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order.
    int
    getUnsignedShort(int index)
    Gets an unsigned 16-bit short integer at the specified absolute index in this buffer.
    int
    getUnsignedShortLE(int index)
    Gets an unsigned 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
    int
    hashCode()
    Returns a hash code which was calculated from the content of this buffer.
    int
    indexOf(int fromIndex, int toIndex, byte value)
    Locates the first occurrence of the specified value in this buffer.
    boolean
    isReadable()
    Returns true if and only if (this.writerIndex - this.readerIndex) is greater than 0.
    boolean
    isReadable(int numBytes)
    Returns true if and only if this buffer contains equal to or more than the specified number of elements.
    boolean
    isReadOnly()
    Returns true if and only if this buffer is read-only.
    boolean
    isWritable()
    Returns true if and only if (this.capacity - this.writerIndex) is greater than 0.
    boolean
    isWritable(int numBytes)
    Returns true if and only if this buffer has enough room to allow writing the specified number of elements.
    ByteBuf
    markReaderIndex()
    Marks the current readerIndex in this buffer.
    ByteBuf
    markWriterIndex()
    Marks the current writerIndex in this buffer.
    int
    maxCapacity()
    Returns the maximum allowed capacity of this buffer.
    protected final void
    maxCapacity(int maxCapacity)
     
    int
    maxWritableBytes()
    Returns the maximum possible number of writable bytes, which is equal to (this.maxCapacity - this.writerIndex).
    ByteBuffer
    nioBuffer()
    Exposes this buffer's readable bytes as an NIO ByteBuffer.
    ByteBuffer[]
    nioBuffers()
    Exposes this buffer's readable bytes as an NIO ByteBuffer's.
    ByteBuf
    order(ByteOrder endianness)
    Returns a buffer with the specified endianness which shares the whole region, indexes, and marks of this buffer.
    int
    readableBytes()
    Returns the number of readable bytes which is equal to (this.writerIndex - this.readerIndex).
    boolean
    readBoolean()
    Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.
    byte
    readByte()
    Gets a byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
    ByteBuf
    readBytes(byte[] dst)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= dst.length).
    ByteBuf
    readBytes(int length)
    Transfers this buffer's data to a newly created buffer starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    ByteBuf
    readBytes(ByteBuf dst)
    Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination becomes non-writable, and increases the readerIndex by the number of the transferred bytes.
    ByteBuf
    readBytes(ByteBuf dst, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    ByteBuf
    readBytes(ByteBuf dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    char
    readChar()
    Gets a 2-byte UTF-16 character at the current readerIndex and increases the readerIndex by 2 in this buffer.
    CharSequence
    readCharSequence(int length, Charset charset)
    Gets a CharSequence with the given length at the current readerIndex and increases the readerIndex by the given length.
    double
    readDouble()
    Gets a 64-bit floating point number at the current readerIndex and increases the readerIndex by 8 in this buffer.
    int
    readerIndex()
    Returns the readerIndex of this buffer.
    ByteBuf
    readerIndex(int readerIndex)
    Sets the readerIndex of this buffer.
    float
    readFloat()
    Gets a 32-bit floating point number at the current readerIndex and increases the readerIndex by 4 in this buffer.
    int
    readInt()
    Gets a 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
    int
    readIntLE()
    Gets a 32-bit integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 4 in this buffer.
    long
    readLong()
    Gets a 64-bit integer at the current readerIndex and increases the readerIndex by 8 in this buffer.
    long
    readLongLE()
    Gets a 64-bit integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 8 in this buffer.
    int
    readMedium()
    Gets a 24-bit medium integer at the current readerIndex and increases the readerIndex by 3 in this buffer.
    int
    readMediumLE()
    Gets a 24-bit medium integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 3 in this buffer.
    ByteBuf
    readRetainedSlice(int length)
    Returns a new retained slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).
    short
    readShort()
    Gets a 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
    short
    readShortLE()
    Gets a 16-bit short integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 2 in this buffer.
    ByteBuf
    readSlice(int length)
    Returns a new slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).
    short
    readUnsignedByte()
    Gets an unsigned byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
    long
    readUnsignedInt()
    Gets an unsigned 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
    long
    readUnsignedIntLE()
    Gets an unsigned 32-bit integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 4 in this buffer.
    int
    readUnsignedMedium()
    Gets an unsigned 24-bit medium integer at the current readerIndex and increases the readerIndex by 3 in this buffer.
    int
    readUnsignedMediumLE()
    Gets an unsigned 24-bit medium integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 3 in this buffer.
    int
    readUnsignedShort()
    Gets an unsigned 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
    int
    readUnsignedShortLE()
    Gets an unsigned 16-bit short integer at the current readerIndex in the Little Endian Byte Order and increases the readerIndex by 2 in this buffer.
    ByteBuf
    resetReaderIndex()
    Repositions the current readerIndex to the marked readerIndex in this buffer.
    ByteBuf
    resetWriterIndex()
    Repositions the current writerIndex to the marked writerIndex in this buffer.
    ByteBuf
    retainedDuplicate()
    Returns a retained buffer which shares the whole region of this buffer.
    ByteBuf
    retainedSlice()
    Returns a retained slice of this buffer's readable bytes.
    ByteBuf
    retainedSlice(int index, int length)
    Returns a retained slice of this buffer's sub-region.
    ByteBuf
    setBoolean(int index, boolean value)
    Sets the specified boolean at the specified absolute index in this buffer.
    ByteBuf
    setBytes(int index, byte[] src)
    Transfers the specified source array's data to this buffer starting at the specified absolute index.
    ByteBuf
    setBytes(int index, ByteBuf src)
    Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer becomes unreadable.
    ByteBuf
    setBytes(int index, ByteBuf src, int length)
    Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
    ByteBuf
    setChar(int index, int value)
    Sets the specified 2-byte UTF-16 character at the specified absolute index in this buffer.
    int
    setCharSequence(int index, CharSequence sequence, Charset charset)
    Writes the specified CharSequence at the given index.
    ByteBuf
    setDouble(int index, double value)
    Sets the specified 64-bit floating-point number at the specified absolute index in this buffer.
    ByteBuf
    setFloat(int index, float value)
    Sets the specified 32-bit floating-point number at the specified absolute index in this buffer.
    ByteBuf
    setIndex(int readerIndex, int writerIndex)
    Sets the readerIndex and writerIndex of this buffer in one shot.
    ByteBuf
    setIntLE(int index, int value)
    Sets the specified 32-bit integer at the specified absolute index in this buffer with Little Endian byte order .
    ByteBuf
    setLongLE(int index, long value)
    Sets the specified 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order.
    ByteBuf
    setMediumLE(int index, int value)
    Sets the specified 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order.
    ByteBuf
    setShortLE(int index, int value)
    Sets the specified 16-bit short integer at the specified absolute index in this buffer with the Little Endian Byte Order.
    ByteBuf
    skipBytes(int length)
    Increases the current readerIndex by the specified length in this buffer.
    ByteBuf
    slice()
    Returns a slice of this buffer's readable bytes.
    ByteBuf
    slice(int index, int length)
    Returns a slice of this buffer's sub-region.
    String
    toString()
    Returns the string representation of this buffer.
    String
    toString(int index, int length, Charset charset)
    Decodes this buffer's sub-region into a string with the specified character set.
    String
    toString(Charset charset)
    Decodes this buffer's readable bytes into a string with the specified character set name.
    protected final void
    trimIndicesToCapacity(int newCapacity)
     
    int
    writableBytes()
    Returns the number of writable bytes which is equal to (this.capacity - this.writerIndex).
    ByteBuf
    writeBoolean(boolean value)
    Sets the specified boolean at the current writerIndex and increases the writerIndex by 1 in this buffer.
    ByteBuf
    writeByte(int value)
    Sets the specified byte at the current writerIndex and increases the writerIndex by 1 in this buffer.
    ByteBuf
    writeBytes(byte[] src)
    Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= src.length).
    ByteBuf
    writeBytes(byte[] src, int srcIndex, int length)
    Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
    ByteBuf
    writeBytes(ByteBuf src)
    Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer becomes unreadable, and increases the writerIndex by the number of the transferred bytes.
    ByteBuf
    writeBytes(ByteBuf src, int length)
    Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
    ByteBuf
    writeBytes(ByteBuf src, int srcIndex, int length)
    Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
    int
    writeBytes(InputStream in, int length)
    Transfers the content of the specified stream to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes.
    ByteBuf
    writeBytes(ByteBuffer src)
    Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
    int
    writeBytes(FileChannel in, long position, int length)
    Transfers the content of the specified channel starting at the given file position to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes.
    int
    writeBytes(ScatteringByteChannel in, int length)
    Transfers the content of the specified channel to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes.
    ByteBuf
    writeChar(int value)
    Sets the specified 2-byte UTF-16 character at the current writerIndex and increases the writerIndex by 2 in this buffer.
    int
    writeCharSequence(CharSequence sequence, Charset charset)
    Writes the specified CharSequence at the current writerIndex and increases the writerIndex by the written bytes. in this buffer.
    ByteBuf
    writeDouble(double value)
    Sets the specified 64-bit floating point number at the current writerIndex and increases the writerIndex by 8 in this buffer.
    ByteBuf
    writeFloat(float value)
    Sets the specified 32-bit floating point number at the current writerIndex and increases the writerIndex by 4 in this buffer.
    ByteBuf
    writeInt(int value)
    Sets the specified 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
    ByteBuf
    writeIntLE(int value)
    Sets the specified 32-bit integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 4 in this buffer.
    ByteBuf
    writeLong(long value)
    Sets the specified 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
    ByteBuf
    writeLongLE(long value)
    Sets the specified 64-bit long integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 8 in this buffer.
    ByteBuf
    writeMedium(int value)
    Sets the specified 24-bit medium integer at the current writerIndex and increases the writerIndex by 3 in this buffer.
    ByteBuf
    writeMediumLE(int value)
    Sets the specified 24-bit medium integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 3 in this buffer.
    int
    writerIndex()
    Returns the writerIndex of this buffer.
    ByteBuf
    writerIndex(int writerIndex)
    Sets the writerIndex of this buffer.
    ByteBuf
    writeShort(int value)
    Sets the specified 16-bit short integer at the current writerIndex and increases the writerIndex by 2 in this buffer.
    ByteBuf
    writeShortLE(int value)
    Sets the specified 16-bit short integer in the Little Endian Byte Order at the current writerIndex and increases the writerIndex by 2 in this buffer.

    Methods inherited from class ByteBuf

    asByteBuf, getDoubleLE, getFloatLE, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
    Modifier and Type
    Method
    Description
    ByteBuf
    asByteBuf()
    A ByteBuf can turn into itself.
    double
    getDoubleLE(int index)
    Gets a 64-bit floating point number at the specified absolute index in this buffer in Little Endian Byte Order.
    float
    getFloatLE(int index)
    Gets a 32-bit floating point number at the specified absolute index in this buffer in Little Endian Byte Order.
    int
    maxFastWritableBytes()
    Returns the maximum number of bytes which can be written for certain without involving an internal reallocation or data-copy.
    double
    readDoubleLE()
    Gets a 64-bit floating point number at the current readerIndex in Little Endian Byte Order and increases the readerIndex by 8 in this buffer.
    float
    readFloatLE()
    Gets a 32-bit floating point number at the current readerIndex in Little Endian Byte Order and increases the readerIndex by 4 in this buffer.
    ByteBuf
    setDoubleLE(int index, double value)
    Sets the specified 64-bit floating-point number at the specified absolute index in this buffer in Little Endian Byte Order.
    ByteBuf
    setFloatLE(int index, float value)
    Sets the specified 32-bit floating-point number at the specified absolute index in this buffer in Little Endian Byte Order.
    ByteBuf
    writeDoubleLE(double value)
    Sets the specified 64-bit floating point number at the current writerIndex in Little Endian Byte Order and increases the writerIndex by 8 in this buffer.
    ByteBuf
    writeFloatLE(float value)
    Sets the specified 32-bit floating point number at the current writerIndex in Little Endian Byte Order and increases the writerIndex by 4 in this buffer.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UnpooledUnsafeDirectByteBuf

      public UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, int initialCapacity, int maxCapacity)
      Creates a new direct buffer.
      Parameters:
      initialCapacity - the initial capacity of the underlying direct buffer
      maxCapacity - the maximum capacity of the underlying direct buffer
    • UnpooledUnsafeDirectByteBuf

      protected UnpooledUnsafeDirectByteBuf(ByteBufAllocator alloc, ByteBuffer initialBuffer, int maxCapacity)
      Creates a new direct buffer by wrapping the specified initial buffer.
      Parameters:
      maxCapacity - the maximum capacity of the underlying direct buffer
  • Method Details

    • hasMemoryAddress

      public boolean hasMemoryAddress()
      Description copied from class: ByteBuf
      Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
      Overrides:
      hasMemoryAddress in class UnpooledDirectByteBuf
    • memoryAddress

      public long memoryAddress()
      Description copied from class: ByteBuf
      Returns the low-level memory address that point to the first byte of ths backing data.
      Overrides:
      memoryAddress in class UnpooledDirectByteBuf
    • getByte

      public byte getByte(int index)
      Description copied from class: ByteBuf
      Gets a byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      getByte in class UnpooledDirectByteBuf
    • _getByte

      protected byte _getByte(int index)
      Overrides:
      _getByte in class UnpooledDirectByteBuf
    • getShort

      public short getShort(int index)
      Description copied from class: ByteBuf
      Gets a 16-bit short integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      getShort in class UnpooledDirectByteBuf
    • _getShort

      protected short _getShort(int index)
      Overrides:
      _getShort in class UnpooledDirectByteBuf
    • _getShortLE

      protected short _getShortLE(int index)
      Overrides:
      _getShortLE in class UnpooledDirectByteBuf
    • getUnsignedMedium

      public int getUnsignedMedium(int index)
      Description copied from class: ByteBuf
      Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      getUnsignedMedium in class UnpooledDirectByteBuf
    • _getUnsignedMedium

      protected int _getUnsignedMedium(int index)
      Overrides:
      _getUnsignedMedium in class UnpooledDirectByteBuf
    • _getUnsignedMediumLE

      protected int _getUnsignedMediumLE(int index)
      Overrides:
      _getUnsignedMediumLE in class UnpooledDirectByteBuf
    • getInt

      public int getInt(int index)
      Description copied from class: ByteBuf
      Gets a 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      getInt in class UnpooledDirectByteBuf
    • _getInt

      protected int _getInt(int index)
      Overrides:
      _getInt in class UnpooledDirectByteBuf
    • _getIntLE

      protected int _getIntLE(int index)
      Overrides:
      _getIntLE in class UnpooledDirectByteBuf
    • getLong

      public long getLong(int index)
      Description copied from class: ByteBuf
      Gets a 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      getLong in class UnpooledDirectByteBuf
    • _getLong

      protected long _getLong(int index)
      Overrides:
      _getLong in class UnpooledDirectByteBuf
    • _getLongLE

      protected long _getLongLE(int index)
      Overrides:
      _getLongLE in class UnpooledDirectByteBuf
    • getBytes

      public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
      Description copied from class: ByteBuf
      Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
      Overrides:
      getBytes in class UnpooledDirectByteBuf
      Parameters:
      dstIndex - the first index of the destination
      length - the number of bytes to transfer
    • setByte

      public ByteBuf setByte(int index, int value)
      Description copied from class: ByteBuf
      Sets the specified byte at the specified absolute index 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.
      Overrides:
      setByte in class UnpooledDirectByteBuf
    • _setByte

      protected void _setByte(int index, int value)
      Overrides:
      _setByte in class UnpooledDirectByteBuf
    • setShort

      public ByteBuf setShort(int index, int value)
      Description copied from class: ByteBuf
      Sets the specified 16-bit short integer at the specified absolute index 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.
      Overrides:
      setShort in class UnpooledDirectByteBuf
    • _setShort

      protected void _setShort(int index, int value)
      Overrides:
      _setShort in class UnpooledDirectByteBuf
    • _setShortLE

      protected void _setShortLE(int index, int value)
      Overrides:
      _setShortLE in class UnpooledDirectByteBuf
    • setMedium

      public ByteBuf setMedium(int index, int value)
      Description copied from class: ByteBuf
      Sets the specified 24-bit medium integer at the specified absolute index 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.
      Overrides:
      setMedium in class UnpooledDirectByteBuf
    • _setMedium

      protected void _setMedium(int index, int value)
      Overrides:
      _setMedium in class UnpooledDirectByteBuf
    • _setMediumLE

      protected void _setMediumLE(int index, int value)
      Overrides:
      _setMediumLE in class UnpooledDirectByteBuf
    • setInt

      public ByteBuf setInt(int index, int value)
      Description copied from class: ByteBuf
      Sets the specified 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setInt in class UnpooledDirectByteBuf
    • _setInt

      protected void _setInt(int index, int value)
      Overrides:
      _setInt in class UnpooledDirectByteBuf
    • _setIntLE

      protected void _setIntLE(int index, int value)
      Overrides:
      _setIntLE in class UnpooledDirectByteBuf
    • setLong

      public ByteBuf setLong(int index, long value)
      Description copied from class: ByteBuf
      Sets the specified 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setLong in class UnpooledDirectByteBuf
    • _setLong

      protected void _setLong(int index, long value)
      Overrides:
      _setLong in class UnpooledDirectByteBuf
    • _setLongLE

      protected void _setLongLE(int index, long value)
      Overrides:
      _setLongLE in class UnpooledDirectByteBuf
    • setBytes

      public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)
      Description copied from class: ByteBuf
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
      Overrides:
      setBytes in class UnpooledDirectByteBuf
      Parameters:
      srcIndex - the first index of the source
      length - the number of bytes to transfer
    • setBytes

      public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
      Description copied from class: ByteBuf
      Transfers the specified source array's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setBytes in class UnpooledDirectByteBuf
    • setBytes

      public ByteBuf setBytes(int index, ByteBuffer src)
      Description copied from class: ByteBuf
      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. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setBytes in class UnpooledDirectByteBuf
    • setBytes

      public int setBytes(int index, InputStream in, int length) throws IOException
      Description copied from class: ByteBuf
      Transfers the content of the specified source stream to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setBytes in class UnpooledDirectByteBuf
      Parameters:
      length - the number of bytes to transfer
      Returns:
      the actual number of bytes read in from the specified channel. -1 if the specified InputStream reached EOF.
      Throws:
      IOException - if the specified stream threw an exception during I/O
    • copy

      public ByteBuf copy(int index, int length)
      Description copied from class: ByteBuf
      Returns a copy of this buffer's sub-region. Modifying the content of the returned buffer or this buffer does not affect each other at all. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      copy in class UnpooledDirectByteBuf
    • newSwappedByteBuf

      protected SwappedByteBuf newSwappedByteBuf()
      Description copied from class: AbstractByteBuf
      Creates a new SwappedByteBuf for this ByteBuf instance.
      Overrides:
      newSwappedByteBuf in class AbstractByteBuf
    • setZero

      public ByteBuf setZero(int index, int length)
      Description copied from class: ByteBuf
      Fills this buffer with NUL (0x00) starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
      Overrides:
      setZero in class AbstractByteBuf
      Parameters:
      length - the number of NULs to write to the buffer
    • writeZero

      public ByteBuf writeZero(int length)
      Description copied from class: ByteBuf
      Fills this buffer with NUL (0x00) starting at the current writerIndex and increases the writerIndex by the specified length. If this.writableBytes is less than length, ByteBuf.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
      Overrides:
      writeZero in class AbstractByteBuf
      Parameters:
      length - the number of NULs to write to the buffer
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.