MCPcopy Index your code
hub / github.com/apache/tomcat / append

Method append

java/org/apache/catalina/tribes/io/XByteBuffer.java:200–218  ·  view source on GitHub ↗

Appends the data to the buffer. If the data is incorrectly formatted, ie, the data should always start with the header, false will be returned and the data will be discarded. @param b - bytes to be appended @param len - the number of bytes to append. @return true if the data was appended correct

(ByteBuffer b, int len)

Source from the content-addressed store, hash-verified

198 * something, or the length of data is 0
199 */
200 public boolean append(ByteBuffer b, int len) {
201 int newcount = bufSize + len;
202 if (newcount > buf.length) {
203 expand(newcount);
204 }
205 b.get(buf, bufSize, len);
206
207 bufSize = newcount;
208
209 if (discard) {
210 if (bufSize > START_DATA.length && (firstIndexOf(buf, 0, START_DATA) == -1)) {
211 bufSize = 0;
212 log.error(sm.getString("xByteBuffer.discarded.invalidHeader"));
213 return false;
214 }
215 }
216 return true;
217
218 }
219
220 /**
221 * Appends a single byte to the buffer.

Callers 15

mainMethod · 0.95
testViaFileMethod · 0.95
testPickupMethod · 0.95
runMethod · 0.95
deliverMethod · 0.95
sendMethod · 0.95
sendMessageMethod · 0.95
messageReceivedMethod · 0.95
getNameInternalMethod · 0.45
createObjectNameMethod · 0.45
getONameForUpgradeMethod · 0.45
setRequestMethod · 0.45

Calls 6

expandMethod · 0.95
firstIndexOfMethod · 0.95
toBytesMethod · 0.95
getMethod · 0.65
errorMethod · 0.65
getStringMethod · 0.65

Tested by 5

mainMethod · 0.76
testViaFileMethod · 0.76
testPickupMethod · 0.76
runMethod · 0.76
deliverMethod · 0.76