Class DefaultByteBufHolder
- All Implemented Interfaces:
ByteBufHolder, ReferenceCounted
- Direct Known Subclasses:
DefaultBulkStringRedisContent, DefaultHttp2GoAwayFrame, DefaultHttp2UnknownFrame, DefaultSmtpContent, DefaultSpdyUnknownFrame, DefaultStompContentSubframe, FullBulkStringRedisMessage, HAProxyTLV, SctpMessage, UdtMessage, WebSocketFrame
-
Constructor Summary
Constructors
-
Method Summary
Modifier and Type
Method
Description
boolean
This implementation of the equals operation is restricted to
work only with instances of the same class.
int
int
Returns the reference count of this object.
boolean
Decreases the reference count by 1 and deallocates this object if the reference count reaches at
0.
boolean
Decreases the reference count by the specified decrement and deallocates this object if the reference
count reaches at 0.
Returns a new
ByteBufHolder which contains the specified
content.
Increases the reference count by 1.
Increases the reference count by the specified increment.
Records the current access location of this object for debugging purposes.
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
-
Constructor Details
-
DefaultByteBufHolder
public DefaultByteBufHolder(ByteBuf data)
-
Method Details
-
-
-
-
-
-
refCnt
public int refCnt()
Returns the reference count of this object. If 0, it means this object has been deallocated.
- Specified by:
refCnt in interface ReferenceCounted
-
-
-
-
touch
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()
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)
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()
-
-
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.
-