Top Description Constructors Methods
io.netty.channel.socket

public Class DatagramPacket

extends DefaultAddressedEnvelope<ByteBuf, InetSocketAddress>
implements ByteBufHolder
Class Inheritance
All Implemented Interfaces
io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted
Imports
io.netty.buffer.ByteBuf, .ByteBufHolder, io.netty.channel.DefaultAddressedEnvelope, java.net.InetSocketAddress

The message container that is used for DatagramChannel to communicate with the remote peer.

Constructor Summary

AccessConstructor and Description
public
DatagramPacket(ByteBuf data, InetSocketAddress recipient)

Create a new instance with the specified packet data and recipient address.

public
DatagramPacket(ByteBuf data, InetSocketAddress recipient, InetSocketAddress sender)

Create a new instance with the specified packet data, recipient address, and sender address.

Method Summary

Modifier and TypeMethod and Description
public DatagramPacket
copy()

Implements io.netty.buffer.ByteBufHolder.copy.

Creates a deep copy of this ByteBufHolder.
public DatagramPacket
public DatagramPacket
replace(ByteBuf content)

Implements io.netty.buffer.ByteBufHolder.replace.

Returns a new ByteBufHolder which contains the specified content.
public DatagramPacket
public DatagramPacket
retain(int increment)

Overrides io.netty.channel.DefaultAddressedEnvelope.retain.

Implements io.netty.buffer.ByteBufHolder.retain, io.netty.channel.AddressedEnvelope.retain.

Increases the reference count by the specified increment.
public DatagramPacket
public DatagramPacket
touch()

Overrides io.netty.channel.DefaultAddressedEnvelope.touch.

Implements io.netty.buffer.ByteBufHolder.touch, io.netty.channel.AddressedEnvelope.touch.

Records the current access location of this object for debugging purposes.
public DatagramPacket
touch(Object hint)

Overrides io.netty.channel.DefaultAddressedEnvelope.touch.

Implements io.netty.buffer.ByteBufHolder.touch, io.netty.channel.AddressedEnvelope.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from io.netty.channel.DefaultAddressedEnvelope:
contentrecipientrefCntreleasereleasesendertoString

Constructor Detail

DatagramPacketback to summary
public DatagramPacket(ByteBuf data, InetSocketAddress recipient)

Create a new instance with the specified packet data and recipient address.

DatagramPacketback to summary
public DatagramPacket(ByteBuf data, InetSocketAddress recipient, InetSocketAddress sender)

Create a new instance with the specified packet data, recipient address, and sender address.

Method Detail

copyback to summary
public DatagramPacket copy()

Implements io.netty.buffer.ByteBufHolder.copy.

Doc from io.netty.buffer.ByteBufHolder.copy.

Creates a deep copy of this ByteBufHolder.

Annotations
@Override
duplicateback to summary
public DatagramPacket duplicate()

Implements io.netty.buffer.ByteBufHolder.duplicate.

Doc from io.netty.buffer.ByteBufHolder.duplicate.

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

Annotations
@Override
replaceback to summary
public DatagramPacket replace(ByteBuf content)

Implements io.netty.buffer.ByteBufHolder.replace.

Doc from io.netty.buffer.ByteBufHolder.replace.

Returns a new ByteBufHolder which contains the specified content.

Annotations
@Override
retainback to summary
public DatagramPacket retain()

Overrides io.netty.channel.DefaultAddressedEnvelope.retain.

Implements io.netty.buffer.ByteBufHolder.retain, io.netty.channel.AddressedEnvelope.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@Override
retainback to summary
public DatagramPacket retain(int increment)

Overrides io.netty.channel.DefaultAddressedEnvelope.retain.

Implements io.netty.buffer.ByteBufHolder.retain, io.netty.channel.AddressedEnvelope.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
retainedDuplicateback to summary
public DatagramPacket retainedDuplicate()

Implements io.netty.buffer.ByteBufHolder.retainedDuplicate.

Doc from io.netty.buffer.ByteBufHolder.retainedDuplicate.

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

Annotations
@Override
touchback to summary
public DatagramPacket touch()

Overrides io.netty.channel.DefaultAddressedEnvelope.touch.

Implements io.netty.buffer.ByteBufHolder.touch, io.netty.channel.AddressedEnvelope.touch.

Doc from io.netty.util.ReferenceCounted.touch.

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).

Annotations
@Override
touchback to summary
public DatagramPacket touch(Object hint)

Overrides io.netty.channel.DefaultAddressedEnvelope.touch.

Implements io.netty.buffer.ByteBufHolder.touch, io.netty.channel.AddressedEnvelope.touch.

Doc from io.netty.util.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.

Annotations
@Override