MCPcopy Create free account
hub / github.com/BaseXdb/basex / readLine

Method readLine

basex-core/src/main/java/org/basex/util/http/Payload.java:206–219  ·  view source on GitHub ↗

Reads the next line of an HTTP multipart content. @return line, or null if end of stream is reached @throws IOException I/O Exception

()

Source from the content-addressed store, hash-verified

204 * @throws IOException I/O Exception
205 */
206 private byte[] readLine() throws IOException {
207 final ByteList bl = new ByteList();
208 for(int b; (b = input.read()) != -1;) {
209 // RFC 1341: a line ends with CRLF
210 while(b == '\r') {
211 b = input.read();
212 if(b == '\n') return bl.finish();
213 bl.add('\r');
214 if(b == -1) return bl.finish();
215 }
216 bl.add(b);
217 }
218 return bl.isEmpty() ? null : bl.finish();
219 }
220
221 /**
222 * Extracts the encapsulation boundary from the media type.

Callers 6

extractPartsMethod · 0.95
extractPartMethod · 0.95
multiFormMethod · 0.95
readMethod · 0.45
writeMethod · 0.45
readMethod · 0.45

Calls 4

finishMethod · 0.95
addMethod · 0.95
readMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected