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
  • DefaultByteBufHolder

This view

  • Original page
  • New address

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

Class DefaultByteBufHolder

java.lang.Object
io.netty.buffer.DefaultByteBufHolder
All Implemented Interfaces:
ByteBufHolder, ReferenceCounted
Direct Known Subclasses:
DefaultBulkStringRedisContent, DefaultHttp2GoAwayFrame, DefaultHttp2UnknownFrame, DefaultSmtpContent, DefaultSpdyUnknownFrame, DefaultStompContentSubframe, FullBulkStringRedisMessage, HAProxyTLV, SctpMessage, UdtMessage, WebSocketFrame

public class DefaultByteBufHolder extends Object implements ByteBufHolder
Default implementation of a ByteBufHolder that holds it's data in a ByteBuf.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultByteBufHolder(ByteBuf data)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ByteBuf
    content()
    Return the data which is held by this ByteBufHolder.
    protected final String
    contentToString()
    Return ByteBuf.toString() without checking the reference count first.
    ByteBufHolder
    copy()
    Creates a deep copy of this ByteBufHolder.
    ByteBufHolder
    duplicate()
    Duplicates this ByteBufHolder.
    boolean
    equals(Object o)
    This implementation of the equals operation is restricted to work only with instances of the same class.
    int
    hashCode()
     
    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.
    ByteBufHolder
    replace(ByteBuf content)
    Returns a new ByteBufHolder which contains the specified content.
    ByteBufHolder
    retain()
    Increases the reference count by 1.
    ByteBufHolder
    retain(int increment)
    Increases the reference count by the specified increment.
    ByteBufHolder
    retainedDuplicate()
    Duplicates this ByteBufHolder.
    String
    toString()
     
    ByteBufHolder
    touch()
    Records the current access location of this object for debugging purposes.
    ByteBufHolder
    touch(Object hint)
    Records the current access location of this object with an additional arbitrary information for debugging purposes.

    Methods inherited from class Object

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

    • DefaultByteBufHolder

      public DefaultByteBufHolder(ByteBuf data)
  • Method Details

    • content

      public ByteBuf content()
      Description copied from interface: ByteBufHolder
      Return the data which is held by this ByteBufHolder.
      Specified by:
      content in interface ByteBufHolder
    • copy

      public ByteBufHolder copy()
      Creates a deep copy of this ByteBufHolder.

      This method calls replace(content().copy()) by default.

      Specified by:
      copy in interface ByteBufHolder
    • duplicate

      public ByteBufHolder duplicate()
      Duplicates this ByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().

      This method calls replace(content().duplicate()) by default.

      Specified by:
      duplicate in interface ByteBufHolder
    • retainedDuplicate

      public ByteBufHolder retainedDuplicate()
      Duplicates this ByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().

      This method calls replace(content().retainedDuplicate()) by default.

      Specified by:
      retainedDuplicate in interface ByteBufHolder
      See Also:
      • ByteBuf.retainedDuplicate()
    • replace

      public ByteBufHolder replace(ByteBuf content)
      Returns a new ByteBufHolder which contains the specified content.

      Override this method to return a new instance of this object whose content is set to the specified content. The default implementation of copy(), duplicate() and retainedDuplicate() invokes this method to create a copy.

      Specified by:
      replace in interface ByteBufHolder
    • refCnt

      public int refCnt()
      Description copied from interface: ReferenceCounted
      Returns the reference count of this object. If 0, it means this object has been deallocated.
      Specified by:
      refCnt in interface ReferenceCounted
    • retain

      public ByteBufHolder retain()
      Description copied from interface: ReferenceCounted
      Increases the reference count by 1.
      Specified by:
      retain in interface ByteBufHolder
      Specified by:
      retain in interface ReferenceCounted
    • retain

      public ByteBufHolder retain(int increment)
      Description copied from interface: ReferenceCounted
      Increases the reference count by the specified increment.
      Specified by:
      retain in interface ByteBufHolder
      Specified by:
      retain in interface ReferenceCounted
    • touch

      public ByteBufHolder touch()
      Description copied from interface: ReferenceCounted
      Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector. This method is a shortcut to touch(null).
      Specified by:
      touch in interface ByteBufHolder
      Specified by:
      touch in interface ReferenceCounted
    • touch

      public ByteBufHolder touch(Object hint)
      Description copied from interface: ReferenceCounted
      Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.
      Specified by:
      touch in interface ByteBufHolder
      Specified by:
      touch in interface ReferenceCounted
    • release

      public boolean release()
      Description copied from interface: ReferenceCounted
      Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
      Specified by:
      release in interface ReferenceCounted
      Returns:
      true if and only if the reference count became 0 and this object has been deallocated
    • release

      public boolean release(int decrement)
      Description copied from interface: ReferenceCounted
      Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
      Specified by:
      release in interface ReferenceCounted
      Returns:
      true if and only if the reference count became 0 and this object has been deallocated
    • contentToString

      protected final String contentToString()
      Return ByteBuf.toString() without checking the reference count first. This is useful to implement toString().
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      This implementation of the equals operation is restricted to work only with instances of the same class. The reason for that is that Netty library already has a number of classes that extend DefaultByteBufHolder and override equals method with an additional comparison logic and we need the symmetric property of the equals operation to be preserved.
      Overrides:
      equals in class Object
      Parameters:
      o - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
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.