MCPcopy Create free account
hub / github.com/jOOQ/jOOQ / readString

Method readString

jOOQ/src/main/java/org/jooq/Source.java:439–464  ·  view source on GitHub ↗

Read the entire #reader() into a String, for convenience. @throws IOException When something goes wrong creating a reader from this source.

()

Source from the content-addressed store, hash-verified

437 * source.
438 */
439 @NotNull
440 public final String readString() throws IOException {
441
442 // [#18817] Skip the allocations if we already have a string.
443 if (string != null && !resolve)
444 return string;
445
446 StringWriter w = new StringWriter();
447 Reader r = null;
448
449 try {
450 r = reader();
451 char[] buffer = new char[8192];
452 int read;
453 while ((read = r.read(buffer, 0, 8192)) >= 0)
454 w.write(buffer, 0, read);
455 }
456 catch (java.io.IOException e) {
457 throw new IOException("Could not read source", e);
458 }
459 finally {
460 safeClose(r);
461 }
462
463 return w.toString();
464 }
465
466 private final Reader inputStreamReader(InputStream is) throws UnsupportedEncodingException {
467 if (charsetName != null)

Callers 15

toStringMethod · 0.95
run0Method · 0.80
loadMethod · 0.80
getMethod · 0.80
setAsciiStreamMethod · 0.80
setUnicodeStreamMethod · 0.80
setCharacterStreamMethod · 0.80
setNCharacterStreamMethod · 0.80
getMethod · 0.80
readMethod · 0.80
get0Method · 0.80
get0Method · 0.80

Calls 4

readerMethod · 0.95
toStringMethod · 0.65
readMethod · 0.45
safeCloseMethod · 0.45

Tested by

no test coverage detected