MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / read

Method read

vm/JavaAPI/src/java/io/StringReader.java:117–128  ·  view source on GitHub ↗

Reads a single character from the source string and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the source string has been reached. @return the character read or -1 if the end of the source string has been reached. @throws IOException

()

Source from the content-addressed store, hash-verified

115 * if this reader is closed.
116 */
117 @Override
118 public int read() throws IOException {
119 synchronized (lock) {
120 if (isClosed()) {
121 throw new IOException("String reader already closed"); //$NON-NLS-1$
122 }
123 if (pos != count) {
124 return str.charAt(pos++);
125 }
126 return -1;
127 }
128 }
129
130 /**
131 * Reads at most {@code len} characters from the source string and stores

Callers

nothing calls this directly

Calls 3

isClosedMethod · 0.95
charAtMethod · 0.65
getCharsMethod · 0.45

Tested by

no test coverage detected