View Javadoc
1   /*
2    * Copyright 2020 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.handler.codec.http3;
17  
18  import io.netty.buffer.ByteBuf;
19  import io.netty.buffer.DefaultByteBufHolder;
20  import io.netty.util.internal.StringUtil;
21  
22  public final class DefaultHttp3DataFrame extends DefaultByteBufHolder implements Http3DataFrame {
23  
24      public DefaultHttp3DataFrame(ByteBuf data) {
25          super(data);
26      }
27  
28      @Override
29      public Http3DataFrame copy() {
30          return new DefaultHttp3DataFrame(content().copy());
31      }
32  
33      @Override
34      public Http3DataFrame duplicate() {
35          return new DefaultHttp3DataFrame(content().duplicate());
36      }
37  
38      @Override
39      public Http3DataFrame retainedDuplicate() {
40          return new DefaultHttp3DataFrame(content().retainedDuplicate());
41      }
42  
43      @Override
44      public Http3DataFrame replace(ByteBuf content) {
45          return new DefaultHttp3DataFrame(content);
46      }
47  
48      @Override
49      public Http3DataFrame retain() {
50          super.retain();
51          return this;
52      }
53  
54      @Override
55      public Http3DataFrame retain(int increment) {
56          super.retain(increment);
57          return this;
58      }
59  
60      @Override
61      public Http3DataFrame touch() {
62          super.touch();
63          return this;
64      }
65  
66      @Override
67      public Http3DataFrame touch(Object hint) {
68          super.touch(hint);
69          return this;
70      }
71  
72      @Override
73      public String toString() {
74          return StringUtil.simpleClassName(this) + "(content=" + content() + ')';
75      }
76  }