MCPcopy Create free account
hub / github.com/ReadyTalk/avian / read

Method read

classpath/java/io/BufferedReader.java:63–96  ·  view source on GitHub ↗
(char[] b, int offset, int length)

Source from the content-addressed store, hash-verified

61 }
62
63 public int read(char[] b, int offset, int length) throws IOException {
64 int count = 0;
65
66 if (position >= limit && length < buffer.length) {
67 fill();
68 }
69
70 if (position < limit) {
71 int remaining = limit - position;
72 if (remaining > length) {
73 remaining = length;
74 }
75
76 System.arraycopy(buffer, position, b, offset, remaining);
77
78 count += remaining;
79 position += remaining;
80 offset += remaining;
81 length -= remaining;
82 }
83
84 if (length > 0) {
85 int c = in.read(b, offset, length);
86 if (c == -1) {
87 if (count == 0) {
88 count = -1;
89 }
90 } else {
91 count += c;
92 }
93 }
94
95 return count;
96 }
97
98 public void close() throws IOException {
99 in.close();

Callers

nothing calls this directly

Calls 3

fillMethod · 0.95
arraycopyMethod · 0.95
readMethod · 0.65

Tested by

no test coverage detected