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

Method recycle

java/org/apache/catalina/connector/InputBuffer.java:180–205  ·  view source on GitHub ↗

Recycle the input buffer.

()

Source from the content-addressed store, hash-verified

178 * Recycle the input buffer.
179 */
180 public void recycle() {
181
182 state = INITIAL_STATE;
183
184 // If usage of mark made the buffer too big, reallocate it
185 if (cb.capacity() > size) {
186 cb = CharBuffer.allocate(size);
187 clear(cb);
188 } else {
189 clear(cb);
190 }
191 readLimit = size;
192 markPos = -1;
193 /*
194 * This buffer will have been replaced if there was data to read so re-initialise to an empty buffer to clear
195 * any reference to an injected buffer.
196 */
197 bb = EMPTY_BUFFER;
198 closed = false;
199
200 if (conv != null) {
201 conv.recycle();
202 encoders.get(conv.getCharset()).push(conv);
203 conv = null;
204 }
205 }
206
207
208 @Override

Callers

nothing calls this directly

Calls 6

clearMethod · 0.95
allocateMethod · 0.65
recycleMethod · 0.65
pushMethod · 0.65
getMethod · 0.65
getCharsetMethod · 0.65

Tested by

no test coverage detected