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
24
25 public interface LastHttpContent extends HttpContent {
26
27
28
29
30 LastHttpContent EMPTY_LAST_CONTENT = new LastHttpContent() {
31
32 @Override
33 public ByteBuf content() {
34 return Unpooled.EMPTY_BUFFER;
35 }
36
37 @Override
38 public LastHttpContent copy() {
39 return EMPTY_LAST_CONTENT;
40 }
41
42 @Override
43 public LastHttpContent duplicate() {
44 return this;
45 }
46
47 @Override
48 public HttpHeaders trailingHeaders() {
49 return HttpHeaders.EMPTY_HEADERS;
50 }
51
52 @Override
53 public DecoderResult getDecoderResult() {
54 return DecoderResult.SUCCESS;
55 }
56
57 @Override
58 public void setDecoderResult(DecoderResult result) {
59 throw new UnsupportedOperationException("read only");
60 }
61
62 @Override
63 public int refCnt() {
64 return 1;
65 }
66
67 @Override
68 public LastHttpContent retain() {
69 return this;
70 }
71
72 @Override
73 public LastHttpContent retain(int increment) {
74 return this;
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
87 @Override
88 public String toString() {
89 return "EmptyLastHttpContent";
90 }
91 };
92
93 HttpHeaders trailingHeaders();
94
95 @Override
96 LastHttpContent copy();
97
98 @Override
99 LastHttpContent retain(int increment);
100
101 @Override
102 LastHttpContent retain();
103 }