1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.channel.socket;
17
18 import io.netty.buffer.ByteBuf;
19 import io.netty.buffer.ByteBufHolder;
20 import io.netty.channel.DefaultAddressedEnvelope;
21
22 import java.net.InetSocketAddress;
23
24
25
26
27 public final class DatagramPacket
28 extends DefaultAddressedEnvelope<ByteBuf, InetSocketAddress> implements ByteBufHolder {
29
30
31
32
33 public DatagramPacket(ByteBuf data, InetSocketAddress recipient) {
34 super(data, recipient);
35 }
36
37
38
39
40
41 public DatagramPacket(ByteBuf data, InetSocketAddress recipient, InetSocketAddress sender) {
42 super(data, recipient, sender);
43 }
44
45 @Override
46 public DatagramPacket copy() {
47 return new DatagramPacket(content().copy(), recipient(), sender());
48 }
49
50 @Override
51 public DatagramPacket duplicate() {
52 return new DatagramPacket(content().duplicate(), recipient(), sender());
53 }
54
55 @Override
56 public DatagramPacket retain() {
57 super.retain();
58 return this;
59 }
60
61 @Override
62 public DatagramPacket retain(int increment) {
63 super.retain(increment);
64 return this;
65 }
66 }