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

Method read

java/org/apache/coyote/ajp/AjpProcessor.java:1186–1204  ·  view source on GitHub ↗

Read at least the specified amount of bytes, and place them in the input buffer. Note that if any data is available to read then this method will always block until at least the specified number of bytes have been read. @param buf Buffer to read data into @param pos Start position @param n

(byte[] buf, int pos, int n, boolean block)

Source from the content-addressed store, hash-verified

1184 * @throws IOException If an I/O error occurs during the read
1185 */
1186 private boolean read(byte[] buf, int pos, int n, boolean block) throws IOException {
1187 int read = socketWrapper.read(block, buf, pos, n);
1188 if (read > 0 && read < n) {
1189 int left = n - read;
1190 int start = pos + read;
1191 while (left > 0) {
1192 read = socketWrapper.read(true, buf, start, left);
1193 if (read == -1) {
1194 throw new EOFException();
1195 }
1196 left = left - read;
1197 start = start + read;
1198 }
1199 } else if (read == -1) {
1200 throw new EOFException();
1201 }
1202
1203 return read > 0;
1204 }
1205
1206
1207 private void writeData(ByteBuffer chunk) throws IOException {

Callers 1

readMessageMethod · 0.95

Calls 1

readMethod · 0.65

Tested by

no test coverage detected