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 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 replace(content().copy());
48 }
49
50 @Override
51 public DatagramPacket duplicate() {
52 return replace(content().duplicate());
53 }
54
55 @Override
56 public DatagramPacket retainedDuplicate() {
57 return replace(content().retainedDuplicate());
58 }
59
60 @Override
61 public DatagramPacket replace(ByteBuf content) {
62 return new DatagramPacket(content, recipient(), sender());
63 }
64
65 @Override
66 public DatagramPacket retain() {
67 super.retain();
68 return this;
69 }
70
71 @Override
72 public DatagramPacket retain(int increment) {
73 super.retain(increment);
74 return this;
75 }
76
77 @Override
78 public DatagramPacket touch() {
79 super.touch();
80 return this;
81 }
82
83 @Override
84 public DatagramPacket touch(Object hint) {
85 super.touch(hint);
86 return this;
87 }
88 }