MCPcopy Index your code
hub / github.com/antlr/codebuff / copy

Method copy

output/java_guava/1.4.17/CharStreams.java:71–84  ·  view source on GitHub ↗

Copies all characters between the Readable and Appendable objects. Does not close or flush either object. @param from the object to read from @param to the object to write to @return the number of characters copied @throws IOException if an I/O error occurs

(Readable from, Appendable to)

Source from the content-addressed store, hash-verified

69 */
70
71 @CanIgnoreReturnValue
72 public static long copy(Readable from, Appendable to) throws IOException {
73 checkNotNull(from);
74 checkNotNull(to);
75 CharBuffer buf = createBuffer();
76 long total = 0;
77 while (from.read(buf) != -1) {
78 buf.flip();
79 to.append(buf);
80 total += buf.remaining();
81 buf.clear();
82 }
83 return total;
84 }
85
86 /**
87 * Reads all characters from a {@link Readable} object into a {@link String}. Does not close the

Callers 3

toStringBuilderMethod · 0.95
writeFromMethod · 0.95
copyToMethod · 0.95

Calls 7

createBufferMethod · 0.95
clearMethod · 0.65
checkNotNullMethod · 0.45
readMethod · 0.45
flipMethod · 0.45
appendMethod · 0.45
remainingMethod · 0.45

Tested by

no test coverage detected