MCPcopy Create free account
hub / github.com/mozilla/rhino / readReader

Method readReader

rhino/src/main/java/org/mozilla/javascript/Kit.java:296–306  ·  view source on GitHub ↗
(Reader reader)

Source from the content-addressed store, hash-verified

294 }
295
296 public static String readReader(Reader reader) throws IOException {
297 try (BufferedReader in = new BufferedReader(reader)) {
298 char[] cbuf = new char[1024];
299 StringBuilder sb = new StringBuilder(1024);
300 int bytes_read;
301 while ((bytes_read = in.read(cbuf, 0, 1024)) != -1) {
302 sb.append(cbuf, 0, bytes_read);
303 }
304 return sb.toString();
305 }
306 }
307
308 public static byte[] readStream(InputStream is, int initialBufferCapacity) throws IOException {
309 if (initialBufferCapacity <= 0) {

Callers 6

fromReaderMethod · 0.95
parseMethod · 0.95
fromReaderMethod · 0.95
buildScopeMethod · 0.95
loadSourceMethod · 0.95
readFileMethod · 0.95

Calls 3

appendMethod · 0.65
toStringMethod · 0.65
readMethod · 0.45

Tested by 1

buildScopeMethod · 0.76