MCPcopy Create free account
hub / github.com/apache/tomcat / VoidInputFilter

Class VoidInputFilter

java/org/apache/coyote/http11/filters/VoidInputFilter.java:31–109  ·  view source on GitHub ↗

Void input filter, which returns -1 when attempting a read. Used with a GET, HEAD, or a similar request.

Source from the content-addressed store, hash-verified

29 * Void input filter, which returns -1 when attempting a read. Used with a GET, HEAD, or a similar request.
30 */
31public class VoidInputFilter implements InputFilter {
32
33 /**
34 * Constructs a new VoidInputFilter.
35 */
36 public VoidInputFilter() {
37 }
38
39
40 // -------------------------------------------------------------- Constants
41
42 /**
43 * Name of the void encoding.
44 */
45 protected static final String ENCODING_NAME = "void";
46 /**
47 * ByteChunk representation of the void encoding name.
48 */
49 protected static final ByteChunk ENCODING = new ByteChunk();
50
51
52 // ----------------------------------------------------- Static Initializer
53
54 static {
55 ENCODING.setBytes(ENCODING_NAME.getBytes(StandardCharsets.ISO_8859_1), 0, ENCODING_NAME.length());
56 }
57
58
59 // ---------------------------------------------------- InputBuffer Methods
60
61 @Override
62 public int doRead(ApplicationBufferHandler handler) throws IOException {
63 return -1;
64 }
65
66
67 // ---------------------------------------------------- InputFilter Methods
68
69 @Override
70 public void setRequest(Request request) {
71 // NOOP: Request isn't used so ignore it
72 }
73
74
75 @Override
76 public void setBuffer(InputBuffer buffer) {
77 // NOOP: No body to read
78 }
79
80
81 @Override
82 public void recycle() {
83 // NOOP
84 }
85
86
87 @Override
88 public ByteChunk getEncodingName() {

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.80
setBytesMethod · 0.45
getBytesMethod · 0.45

Tested by

no test coverage detected