MCPcopy Index your code
hub / github.com/apache/commons-io / read

Method read

src/main/java/org/apache/commons/io/IOUtils.java:2854–2869  ·  view source on GitHub ↗

Reads characters from an input character stream. This implementation guarantees that it will read as many characters as possible before giving up; this may not always be the case for subclasses of Reader. @param input where to read input from @param buffer destination @param offset initial

(final Reader input, final char[] buffer, final int offset, final int length)

Source from the content-addressed store, hash-verified

2852 * @since 2.2
2853 */
2854 public static int read(final Reader input, final char[] buffer, final int offset, final int length)
2855 throws IOException {
2856 if (length < 0) {
2857 throw new IllegalArgumentException("Length must not be negative: " + length);
2858 }
2859 int remaining = length;
2860 while (remaining > 0) {
2861 final int location = length - remaining;
2862 final int count = input.read(buffer, offset + location, remaining);
2863 if (EOF == count) { // EOF
2864 break;
2865 }
2866 remaining -= count;
2867 }
2868 return length - remaining;
2869 }
2870
2871 /**
2872 * Reads characters from an input character stream.

Callers 7

readFullyMethod · 0.95
copyMethod · 0.45
toByteArrayMethod · 0.45
copyLargeMethod · 0.45
contentEqualsMethod · 0.45
skipMethod · 0.45

Calls

no outgoing calls

Tested by 1