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

Method readChar

examples/src/main/java/File.java:169–175  ·  view source on GitHub ↗

Read a single character from the file. Implements a JavaScript function that reads the next character from the file. @return the next character from the file as a single-character string, or null if end of file is reached @throws IOException if an error occurred while accessing the file ass

()

Source from the content-addressed store, hash-verified

167 * object, or if the file cannot be read
168 */
169 @JSFunction
170 public String readChar() throws IOException {
171 int i = getReader().read();
172 if (i == -1) return null;
173 char[] charArray = {(char) i};
174 return new String(charArray);
175 }
176
177 /**
178 * Write strings to the file.

Callers 12

readStringFunction · 0.80
readIdOrNumberFunction · 0.80
readSharpFunction · 0.80
earley-boyer.jsFile · 0.80
sc_readCharFunction · 0.80
readStringFunction · 0.80
readIdOrNumberFunction · 0.80
readSharpFunction · 0.80
earley-boyer.jsFile · 0.80
sc_readCharFunction · 0.80

Calls 2

getReaderMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected