1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.http;
17
18 import io.netty.buffer.ByteBuf;
19 import io.netty.buffer.Unpooled;
20 import io.netty.handler.codec.DecoderResult;
21
22
23 final class ComposedLastHttpContent implements LastHttpContent {
24 private final HttpHeaders trailingHeaders;
25 private DecoderResult result;
26
27 ComposedLastHttpContent(HttpHeaders trailingHeaders) {
28 this.trailingHeaders = trailingHeaders;
29 }
30 @Override
31 public HttpHeaders trailingHeaders() {
32 return trailingHeaders;
33 }
34
35 @Override
36 public LastHttpContent copy() {
37 LastHttpContent content = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER);
38 content.trailingHeaders().set(trailingHeaders());
39 return content;
40 }
41
42 @Override
43 public LastHttpContent retain(int increment) {
44 return this;
45 }
46
47 @Override
48 public LastHttpContent retain() {
49 return this;
50 }
51
52 @Override
53 public HttpContent duplicate() {
54 return copy();
55 }
56
57 @Override
58 public ByteBuf content() {
59 return Unpooled.EMPTY_BUFFER;
60 }
61
62 @Override
63 public DecoderResult getDecoderResult() {
64 return result;
65 }
66
67 @Override
68 public void setDecoderResult(DecoderResult result) {
69 this.result = result;
70 }
71
72 @Override
73 public int refCnt() {
74 return 1;
75 }
76
77 @Override
78 public boolean release() {
79 return false;
80 }
81
82 @Override
83 public boolean release(int decrement) {
84 return false;
85 }
86 }